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 |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame^] | 867 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 868 | # |
| 869 | # Outputs: |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame^] | 870 | # * $outcome: one of PASS/RETRY/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 871 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame^] | 872 | outcome=FAIL |
| 873 | |
| 874 | if [ $TIMES_LEFT -gt 0 ] && |
| 875 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 876 | then |
| 877 | outcome=RETRY |
| 878 | return |
| 879 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 880 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 881 | # 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] | 882 | # (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] | 883 | # expected client exit to incorrectly succeed in case of catastrophic |
| 884 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 885 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 886 | then |
| 887 | if is_polar "$SRV_CMD"; then |
| 888 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 889 | else |
| 890 | fail "server or client failed to reach handshake stage" |
| 891 | return |
| 892 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 893 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 894 | if is_polar "$CLI_CMD"; then |
| 895 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 896 | else |
| 897 | fail "server or client failed to reach handshake stage" |
| 898 | return |
| 899 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 900 | fi |
| 901 | fi |
| 902 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 903 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 904 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 905 | # exit with status 0 when interrupted by a signal, and we don't really |
| 906 | # care anyway), in case e.g. the server reports a memory leak. |
| 907 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 908 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 909 | return |
| 910 | fi |
| 911 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 912 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 913 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 914 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 915 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 916 | 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] | 917 | return |
| 918 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 919 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 920 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 921 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 922 | # 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] | 923 | while [ $# -gt 0 ] |
| 924 | do |
| 925 | case $1 in |
| 926 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 927 | 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] | 928 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 929 | return |
| 930 | fi |
| 931 | ;; |
| 932 | |
| 933 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 934 | 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] | 935 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 936 | return |
| 937 | fi |
| 938 | ;; |
| 939 | |
| 940 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 941 | 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] | 942 | 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] | 943 | return |
| 944 | fi |
| 945 | ;; |
| 946 | |
| 947 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 948 | 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] | 949 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 950 | return |
| 951 | fi |
| 952 | ;; |
| 953 | |
| 954 | # The filtering in the following two options (-u and -U) do the following |
| 955 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 956 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 957 | # - keep one of each non-unique line |
| 958 | # - count how many lines remain |
| 959 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 960 | # if there were no duplicates. |
| 961 | "-U") |
| 962 | 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 |
| 963 | fail "lines following pattern '$2' must be unique in Server output" |
| 964 | return |
| 965 | fi |
| 966 | ;; |
| 967 | |
| 968 | "-u") |
| 969 | 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 |
| 970 | 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] | 971 | return |
| 972 | fi |
| 973 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 974 | "-F") |
| 975 | if ! $2 "$SRV_OUT"; then |
| 976 | fail "function call to '$2' failed on Server output" |
| 977 | return |
| 978 | fi |
| 979 | ;; |
| 980 | "-f") |
| 981 | if ! $2 "$CLI_OUT"; then |
| 982 | fail "function call to '$2' failed on Client output" |
| 983 | return |
| 984 | fi |
| 985 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 986 | "-g") |
| 987 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 988 | fail "function call to '$2' failed on Server and Client output" |
| 989 | return |
| 990 | fi |
| 991 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 992 | |
| 993 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 994 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 995 | exit 1 |
| 996 | esac |
| 997 | shift 2 |
| 998 | done |
| 999 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1000 | # check valgrind's results |
| 1001 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1002 | 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] | 1003 | fail "Server has memory errors" |
| 1004 | return |
| 1005 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1006 | 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] | 1007 | fail "Client has memory errors" |
| 1008 | return |
| 1009 | fi |
| 1010 | fi |
| 1011 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1012 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame^] | 1013 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1014 | } |
| 1015 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1016 | # Run the current test case: start the server and if applicable the proxy, run |
| 1017 | # the client, wait for all processes to finish or time out. |
| 1018 | # |
| 1019 | # Inputs: |
| 1020 | # * $NAME: test case name |
| 1021 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1022 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1023 | # |
| 1024 | # Outputs: |
| 1025 | # * $CLI_EXIT: client return code |
| 1026 | # * $SRV_RET: server return code |
| 1027 | do_run_test_once() { |
| 1028 | # run the commands |
| 1029 | if [ -n "$PXY_CMD" ]; then |
| 1030 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1031 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1032 | PXY_PID=$! |
| 1033 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1034 | fi |
| 1035 | |
| 1036 | check_osrv_dtls |
| 1037 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1038 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1039 | SRV_PID=$! |
| 1040 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1041 | |
| 1042 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1043 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1044 | wait_client_done |
| 1045 | |
| 1046 | sleep 0.05 |
| 1047 | |
| 1048 | # terminate the server (and the proxy) |
| 1049 | kill $SRV_PID |
| 1050 | wait $SRV_PID |
| 1051 | SRV_RET=$? |
| 1052 | |
| 1053 | if [ -n "$PXY_CMD" ]; then |
| 1054 | kill $PXY_PID >/dev/null 2>&1 |
| 1055 | wait $PXY_PID |
| 1056 | fi |
| 1057 | } |
| 1058 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1059 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1060 | # Options: -s pattern pattern that must be present in server output |
| 1061 | # -c pattern pattern that must be present in client output |
| 1062 | # -u pattern lines after pattern must be unique in client output |
| 1063 | # -f call shell function on client output |
| 1064 | # -S pattern pattern that must be absent in server output |
| 1065 | # -C pattern pattern that must be absent in client output |
| 1066 | # -U pattern lines after pattern must be unique in server output |
| 1067 | # -F call shell function on server output |
| 1068 | # -g call shell function on server and client output |
| 1069 | run_test() { |
| 1070 | NAME="$1" |
| 1071 | shift 1 |
| 1072 | |
| 1073 | if is_excluded "$NAME"; then |
| 1074 | SKIP_NEXT="NO" |
| 1075 | # There was no request to run the test, so don't record its outcome. |
| 1076 | return |
| 1077 | fi |
| 1078 | |
| 1079 | print_name "$NAME" |
| 1080 | |
| 1081 | # Do we only run numbered tests? |
| 1082 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1083 | case ",$RUN_TEST_NUMBER," in |
| 1084 | *",$TESTS,"*) :;; |
| 1085 | *) SKIP_NEXT="YES";; |
| 1086 | esac |
| 1087 | fi |
| 1088 | |
| 1089 | # does this test use a proxy? |
| 1090 | if [ "X$1" = "X-p" ]; then |
| 1091 | PXY_CMD="$2" |
| 1092 | shift 2 |
| 1093 | else |
| 1094 | PXY_CMD="" |
| 1095 | fi |
| 1096 | |
| 1097 | # get commands and client output |
| 1098 | SRV_CMD="$1" |
| 1099 | CLI_CMD="$2" |
| 1100 | CLI_EXPECT="$3" |
| 1101 | shift 3 |
| 1102 | |
| 1103 | # Check if test uses files |
| 1104 | case "$SRV_CMD $CLI_CMD" in |
| 1105 | *data_files/*) |
| 1106 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1107 | esac |
| 1108 | |
| 1109 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1110 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1111 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1112 | |
| 1113 | # should we skip? |
| 1114 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1115 | SKIP_NEXT="NO" |
| 1116 | record_outcome "SKIP" |
| 1117 | SKIPS=$(( $SKIPS + 1 )) |
| 1118 | return |
| 1119 | fi |
| 1120 | |
| 1121 | analyze_test_commands "$@" |
| 1122 | |
| 1123 | TIMES_LEFT=2 |
| 1124 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1125 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1126 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1127 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1128 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame^] | 1129 | check_test_failure "$@" |
| 1130 | case $outcome in |
| 1131 | PASS) break;; |
| 1132 | RETRY) printf "RETRY ";; |
| 1133 | FAIL) return;; |
| 1134 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1135 | done |
| 1136 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame^] | 1137 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1138 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1139 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1140 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1141 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1142 | if [ -n "$PXY_CMD" ]; then |
| 1143 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1144 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1145 | fi |
| 1146 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1147 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1148 | } |
| 1149 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1150 | run_test_psa() { |
| 1151 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1152 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 1153 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 1154 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1155 | 0 \ |
| 1156 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1157 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1158 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1159 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1160 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1161 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1162 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1163 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1164 | -C "Failed to setup PSA-based cipher context"\ |
| 1165 | -S "Failed to setup PSA-based cipher context"\ |
| 1166 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1167 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1168 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1169 | -S "error" \ |
| 1170 | -C "error" |
| 1171 | } |
| 1172 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1173 | run_test_psa_force_curve() { |
| 1174 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1175 | run_test "PSA - ECDH with $1" \ |
Gilles Peskine | 12b5b38 | 2021-06-02 10:00:42 +0200 | [diff] [blame] | 1176 | "$P_SRV debug_level=4 force_version=tls1_2 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1177 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 1178 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1179 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1180 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1181 | -c "PSA calc verify" \ |
| 1182 | -c "calc PSA finished" \ |
| 1183 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1184 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1185 | -s "PSA calc verify" \ |
| 1186 | -s "calc PSA finished" \ |
| 1187 | -C "Failed to setup PSA-based cipher context"\ |
| 1188 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1189 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1190 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1191 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1192 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1193 | -C "error" |
| 1194 | } |
| 1195 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1196 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1197 | # a maximum fragment length. |
| 1198 | # first argument ($1) is MFL for SSL client |
| 1199 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1200 | run_test_memory_after_hanshake_with_mfl() |
| 1201 | { |
| 1202 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1203 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1204 | |
| 1205 | # Leave some margin for robustness |
| 1206 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1207 | |
| 1208 | run_test "Handshake memory usage (MFL $1)" \ |
| 1209 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1210 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1211 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1212 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1213 | 0 \ |
| 1214 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1215 | } |
| 1216 | |
| 1217 | |
| 1218 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1219 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1220 | run_tests_memory_after_hanshake() |
| 1221 | { |
| 1222 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1223 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1224 | |
| 1225 | # first test with default MFU is to get reference memory usage |
| 1226 | MEMORY_USAGE_MFL_16K=0 |
| 1227 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1228 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1229 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1230 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1231 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1232 | 0 \ |
| 1233 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1234 | |
| 1235 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1236 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1237 | |
| 1238 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1239 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1240 | |
| 1241 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1242 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1243 | |
| 1244 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1245 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1246 | } |
| 1247 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1248 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1249 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1250 | rm -f context_srv.txt |
| 1251 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1252 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1253 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1254 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1255 | 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] | 1256 | exit 1 |
| 1257 | } |
| 1258 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1259 | # |
| 1260 | # MAIN |
| 1261 | # |
| 1262 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1263 | get_options "$@" |
| 1264 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1265 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1266 | # patterns rather than regular expressions, use a case statement instead |
| 1267 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1268 | # detects simple cases: plain substring, everything, nothing. |
| 1269 | # |
| 1270 | # As an exception, the character '.' is treated as an ordinary character |
| 1271 | # if it is the only special character in the string. This is because it's |
| 1272 | # rare to need "any one character", but needing a literal '.' is common |
| 1273 | # (e.g. '-f "DTLS 1.2"'). |
| 1274 | need_grep= |
| 1275 | case "$FILTER" in |
| 1276 | '^$') simple_filter=;; |
| 1277 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1278 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1279 | need_grep=1;; |
| 1280 | *) # No regexp or shell-pattern special character |
| 1281 | simple_filter="*$FILTER*";; |
| 1282 | esac |
| 1283 | case "$EXCLUDE" in |
| 1284 | '^$') simple_exclude=;; |
| 1285 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1286 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1287 | need_grep=1;; |
| 1288 | *) # No regexp or shell-pattern special character |
| 1289 | simple_exclude="*$EXCLUDE*";; |
| 1290 | esac |
| 1291 | if [ -n "$need_grep" ]; then |
| 1292 | is_excluded () { |
| 1293 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1294 | } |
| 1295 | else |
| 1296 | is_excluded () { |
| 1297 | case "$1" in |
| 1298 | $simple_exclude) true;; |
| 1299 | $simple_filter) false;; |
| 1300 | *) true;; |
| 1301 | esac |
| 1302 | } |
| 1303 | fi |
| 1304 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1305 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1306 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1307 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1308 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1309 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1310 | echo "Command '$P_SRV_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_CLI_BIN" ]; then |
| 1314 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1315 | exit 1 |
| 1316 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1317 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1318 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1319 | exit 1 |
| 1320 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1321 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1322 | if which valgrind >/dev/null 2>&1; then :; else |
| 1323 | echo "Memcheck not possible. Valgrind not found" |
| 1324 | exit 1 |
| 1325 | fi |
| 1326 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1327 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1328 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1329 | exit 1 |
| 1330 | fi |
| 1331 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1332 | # used by watchdog |
| 1333 | MAIN_PID="$$" |
| 1334 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1335 | # We use somewhat arbitrary delays for tests: |
| 1336 | # - how long do we wait for the server to start (when lsof not available)? |
| 1337 | # - how long do we allow for the client to finish? |
| 1338 | # (not to check performance, just to avoid waiting indefinitely) |
| 1339 | # Things are slower with valgrind, so give extra time here. |
| 1340 | # |
| 1341 | # Note: without lsof, there is a trade-off between the running time of this |
| 1342 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1343 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1344 | # 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] | 1345 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1346 | START_DELAY=6 |
| 1347 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1348 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1349 | START_DELAY=2 |
| 1350 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1351 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1352 | |
| 1353 | # some particular tests need more time: |
| 1354 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1355 | # - for the server, we sleep for a number of seconds after the client exits |
| 1356 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1357 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1358 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1359 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1360 | # 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] | 1361 | # +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] | 1362 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1363 | # 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] | 1364 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1365 | 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] | 1366 | 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] | 1367 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1368 | 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] | 1369 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1370 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1371 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1372 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1373 | 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] | 1374 | 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] | 1375 | fi |
| 1376 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1377 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1378 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1379 | 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] | 1380 | fi |
| 1381 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1382 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1383 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1384 | fi |
| 1385 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1386 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1387 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1388 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1389 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1390 | # Allow SHA-1, because many of our test certificates use it |
| 1391 | P_SRV="$P_SRV allow_sha1=1" |
| 1392 | P_CLI="$P_CLI allow_sha1=1" |
| 1393 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1394 | # Also pick a unique name for intermediate files |
| 1395 | SRV_OUT="srv_out.$$" |
| 1396 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1397 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1398 | SESSION="session.$$" |
| 1399 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1400 | SKIP_NEXT="NO" |
| 1401 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1402 | trap cleanup INT TERM HUP |
| 1403 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1404 | # Basic test |
| 1405 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1406 | # Checks that: |
| 1407 | # - 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] | 1408 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1409 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1410 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1411 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1412 | "$P_CLI" \ |
| 1413 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1414 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1415 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1416 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1417 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1418 | -S "error" \ |
| 1419 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1420 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1421 | run_test "Default, DTLS" \ |
| 1422 | "$P_SRV dtls=1" \ |
| 1423 | "$P_CLI dtls=1" \ |
| 1424 | 0 \ |
| 1425 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1426 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1427 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1428 | run_test "TLS client auth: required" \ |
| 1429 | "$P_SRV auth_mode=required" \ |
| 1430 | "$P_CLI" \ |
| 1431 | 0 \ |
| 1432 | -s "Verifying peer X.509 certificate... ok" |
| 1433 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1434 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1435 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1436 | requires_config_enabled MBEDTLS_SHA256_C |
| 1437 | run_test "TLS: password protected client key" \ |
| 1438 | "$P_SRV auth_mode=required" \ |
| 1439 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1440 | 0 |
| 1441 | |
| 1442 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1443 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1444 | requires_config_enabled MBEDTLS_SHA256_C |
| 1445 | run_test "TLS: password protected server key" \ |
| 1446 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1447 | "$P_CLI" \ |
| 1448 | 0 |
| 1449 | |
| 1450 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1451 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1452 | requires_config_enabled MBEDTLS_RSA_C |
| 1453 | requires_config_enabled MBEDTLS_SHA256_C |
| 1454 | run_test "TLS: password protected server key, two certificates" \ |
| 1455 | "$P_SRV \ |
| 1456 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1457 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1458 | "$P_CLI" \ |
| 1459 | 0 |
| 1460 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1461 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1462 | run_test "CA callback on client" \ |
| 1463 | "$P_SRV debug_level=3" \ |
| 1464 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1465 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1466 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1467 | -S "error" \ |
| 1468 | -C "error" |
| 1469 | |
| 1470 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1471 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1472 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1473 | requires_config_enabled MBEDTLS_SHA256_C |
| 1474 | run_test "CA callback on server" \ |
| 1475 | "$P_SRV auth_mode=required" \ |
| 1476 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1477 | key_file=data_files/server5.key" \ |
| 1478 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1479 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1480 | -s "Verifying peer X.509 certificate... ok" \ |
| 1481 | -S "error" \ |
| 1482 | -C "error" |
| 1483 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1484 | # Test using an opaque private key for client authentication |
| 1485 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1486 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1487 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1488 | requires_config_enabled MBEDTLS_SHA256_C |
| 1489 | run_test "Opaque key for client authentication" \ |
| 1490 | "$P_SRV auth_mode=required" \ |
| 1491 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1492 | key_file=data_files/server5.key" \ |
| 1493 | 0 \ |
| 1494 | -c "key type: Opaque" \ |
| 1495 | -s "Verifying peer X.509 certificate... ok" \ |
| 1496 | -S "error" \ |
| 1497 | -C "error" |
| 1498 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1499 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1500 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1501 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1502 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1503 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1504 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1505 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1506 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1507 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1508 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1509 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1510 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1511 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1512 | run_test_psa_force_curve "secp521r1" |
| 1513 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1514 | run_test_psa_force_curve "brainpoolP512r1" |
| 1515 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1516 | run_test_psa_force_curve "secp384r1" |
| 1517 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1518 | run_test_psa_force_curve "brainpoolP384r1" |
| 1519 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1520 | run_test_psa_force_curve "secp256r1" |
| 1521 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1522 | run_test_psa_force_curve "secp256k1" |
| 1523 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1524 | run_test_psa_force_curve "brainpoolP256r1" |
| 1525 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1526 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1527 | ## SECP224K1 is buggy via the PSA API |
| 1528 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1529 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1530 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1531 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1532 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1533 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1534 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1535 | run_test_psa_force_curve "secp192r1" |
| 1536 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1537 | run_test_psa_force_curve "secp192k1" |
| 1538 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1539 | # Test current time in ServerHello |
| 1540 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1541 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1542 | "$P_SRV debug_level=3" \ |
| 1543 | "$P_CLI debug_level=3" \ |
| 1544 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1545 | -f "check_server_hello_time" \ |
| 1546 | -F "check_server_hello_time" |
| 1547 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1548 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1549 | run_test "Unique IV in GCM" \ |
| 1550 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1551 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1552 | 0 \ |
| 1553 | -u "IV used" \ |
| 1554 | -U "IV used" |
| 1555 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1556 | # Tests for certificate verification callback |
| 1557 | run_test "Configuration-specific CRT verification callback" \ |
| 1558 | "$P_SRV debug_level=3" \ |
| 1559 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1560 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1561 | -S "error" \ |
| 1562 | -c "Verify requested for " \ |
| 1563 | -c "Use configuration-specific verification callback" \ |
| 1564 | -C "Use context-specific verification callback" \ |
| 1565 | -C "error" |
| 1566 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1567 | run_test "Context-specific CRT verification callback" \ |
| 1568 | "$P_SRV debug_level=3" \ |
| 1569 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1570 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1571 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1572 | -c "Verify requested for " \ |
| 1573 | -c "Use context-specific verification callback" \ |
| 1574 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1575 | -C "error" |
| 1576 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1577 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1578 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1579 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1580 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1581 | 1 \ |
| 1582 | -c "The certificate is signed with an unacceptable hash" |
| 1583 | |
| 1584 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1585 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1586 | "$P_CLI allow_sha1=1" \ |
| 1587 | 0 |
| 1588 | |
| 1589 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1590 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1591 | "$P_CLI allow_sha1=0" \ |
| 1592 | 0 |
| 1593 | |
| 1594 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1595 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1596 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1597 | 1 \ |
| 1598 | -s "The certificate is signed with an unacceptable hash" |
| 1599 | |
| 1600 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1601 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1602 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1603 | 0 |
| 1604 | |
| 1605 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1606 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1607 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1608 | 0 |
| 1609 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1610 | # Dummy TLS 1.3 test |
| 1611 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1612 | # ssl_client2/ssl_server2 example programs works. |
| 1613 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1614 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1615 | "$P_SRV tls13_kex_modes=psk" \ |
| 1616 | "$P_CLI tls13_kex_modes=psk" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1617 | 0 |
| 1618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1619 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1620 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1621 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1622 | 0 |
| 1623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1624 | 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] | 1625 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1626 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1627 | 0 |
| 1628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1629 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1630 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1631 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1632 | 0 |
| 1633 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1634 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1635 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1636 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1637 | 0 |
| 1638 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1639 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1640 | "$P_SRV tls13_kex_modes=all" \ |
| 1641 | "$P_CLI tls13_kex_modes=all" \ |
| 1642 | 0 |
| 1643 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1644 | # Tests for datagram packing |
| 1645 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1646 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1647 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1648 | 0 \ |
| 1649 | -c "next record in same datagram" \ |
| 1650 | -s "next record in same datagram" |
| 1651 | |
| 1652 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1653 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1654 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1655 | 0 \ |
| 1656 | -s "next record in same datagram" \ |
| 1657 | -C "next record in same datagram" |
| 1658 | |
| 1659 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1660 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1661 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1662 | 0 \ |
| 1663 | -S "next record in same datagram" \ |
| 1664 | -c "next record in same datagram" |
| 1665 | |
| 1666 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1667 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1668 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1669 | 0 \ |
| 1670 | -S "next record in same datagram" \ |
| 1671 | -C "next record in same datagram" |
| 1672 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1673 | # Tests for Context serialization |
| 1674 | |
| 1675 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1676 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1677 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1678 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1679 | 0 \ |
| 1680 | -c "Deserializing connection..." \ |
| 1681 | -S "Deserializing connection..." |
| 1682 | |
| 1683 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1684 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1685 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1686 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1687 | 0 \ |
| 1688 | -c "Deserializing connection..." \ |
| 1689 | -S "Deserializing connection..." |
| 1690 | |
| 1691 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1692 | run_test "Context serialization, client serializes, GCM" \ |
| 1693 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1694 | "$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] | 1695 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1696 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1697 | -S "Deserializing connection..." |
| 1698 | |
| 1699 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1700 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1701 | run_test "Context serialization, client serializes, with CID" \ |
| 1702 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1703 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1704 | 0 \ |
| 1705 | -c "Deserializing connection..." \ |
| 1706 | -S "Deserializing connection..." |
| 1707 | |
| 1708 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1709 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1710 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1711 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1712 | 0 \ |
| 1713 | -C "Deserializing connection..." \ |
| 1714 | -s "Deserializing connection..." |
| 1715 | |
| 1716 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1717 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1718 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1719 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1720 | 0 \ |
| 1721 | -C "Deserializing connection..." \ |
| 1722 | -s "Deserializing connection..." |
| 1723 | |
| 1724 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1725 | run_test "Context serialization, server serializes, GCM" \ |
| 1726 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1727 | "$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] | 1728 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1729 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1730 | -s "Deserializing connection..." |
| 1731 | |
| 1732 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1733 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1734 | run_test "Context serialization, server serializes, with CID" \ |
| 1735 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1736 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1737 | 0 \ |
| 1738 | -C "Deserializing connection..." \ |
| 1739 | -s "Deserializing connection..." |
| 1740 | |
| 1741 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1742 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1743 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1744 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1745 | 0 \ |
| 1746 | -c "Deserializing connection..." \ |
| 1747 | -s "Deserializing connection..." |
| 1748 | |
| 1749 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1750 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1751 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1752 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1753 | 0 \ |
| 1754 | -c "Deserializing connection..." \ |
| 1755 | -s "Deserializing connection..." |
| 1756 | |
| 1757 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1758 | run_test "Context serialization, both serialize, GCM" \ |
| 1759 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1760 | "$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] | 1761 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1762 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1763 | -s "Deserializing connection..." |
| 1764 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1765 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1766 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1767 | run_test "Context serialization, both serialize, with CID" \ |
| 1768 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1769 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1770 | 0 \ |
| 1771 | -c "Deserializing connection..." \ |
| 1772 | -s "Deserializing connection..." |
| 1773 | |
| 1774 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1775 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1776 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1777 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1778 | 0 \ |
| 1779 | -c "Deserializing connection..." \ |
| 1780 | -S "Deserializing connection..." |
| 1781 | |
| 1782 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1783 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1784 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1785 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1786 | 0 \ |
| 1787 | -c "Deserializing connection..." \ |
| 1788 | -S "Deserializing connection..." |
| 1789 | |
| 1790 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1791 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1792 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1793 | "$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] | 1794 | 0 \ |
| 1795 | -c "Deserializing connection..." \ |
| 1796 | -S "Deserializing connection..." |
| 1797 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1798 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1799 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1800 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1801 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1802 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1803 | 0 \ |
| 1804 | -c "Deserializing connection..." \ |
| 1805 | -S "Deserializing connection..." |
| 1806 | |
| 1807 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1808 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1809 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1810 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1811 | 0 \ |
| 1812 | -C "Deserializing connection..." \ |
| 1813 | -s "Deserializing connection..." |
| 1814 | |
| 1815 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1816 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1817 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1818 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1819 | 0 \ |
| 1820 | -C "Deserializing connection..." \ |
| 1821 | -s "Deserializing connection..." |
| 1822 | |
| 1823 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1824 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1825 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1826 | "$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] | 1827 | 0 \ |
| 1828 | -C "Deserializing connection..." \ |
| 1829 | -s "Deserializing connection..." |
| 1830 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1831 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1832 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1833 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1834 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1835 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1836 | 0 \ |
| 1837 | -C "Deserializing connection..." \ |
| 1838 | -s "Deserializing connection..." |
| 1839 | |
| 1840 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1841 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1842 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1843 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1844 | 0 \ |
| 1845 | -c "Deserializing connection..." \ |
| 1846 | -s "Deserializing connection..." |
| 1847 | |
| 1848 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1849 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1850 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1851 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1852 | 0 \ |
| 1853 | -c "Deserializing connection..." \ |
| 1854 | -s "Deserializing connection..." |
| 1855 | |
| 1856 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1857 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1858 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1859 | "$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] | 1860 | 0 \ |
| 1861 | -c "Deserializing connection..." \ |
| 1862 | -s "Deserializing connection..." |
| 1863 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1864 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1865 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1866 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1867 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1868 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1869 | 0 \ |
| 1870 | -c "Deserializing connection..." \ |
| 1871 | -s "Deserializing connection..." |
| 1872 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1873 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1874 | run_test "Saving the serialized context to a file" \ |
| 1875 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1876 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1877 | 0 \ |
| 1878 | -s "Save serialized context to a file... ok" \ |
| 1879 | -c "Save serialized context to a file... ok" |
| 1880 | rm -f context_srv.txt |
| 1881 | rm -f context_cli.txt |
| 1882 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1883 | # Tests for DTLS Connection ID extension |
| 1884 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1885 | # So far, the CID API isn't implemented, so we can't |
| 1886 | # grep for output witnessing its use. This needs to be |
| 1887 | # changed once the CID extension is implemented. |
| 1888 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1889 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1890 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1891 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1892 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1893 | 0 \ |
| 1894 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1895 | -s "found CID extension" \ |
| 1896 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1897 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1898 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1899 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1900 | -C "found CID extension" \ |
| 1901 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1902 | -C "Copy CIDs into SSL transform" \ |
| 1903 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1904 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1905 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1906 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1907 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1908 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1909 | 0 \ |
| 1910 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1911 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1912 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1913 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1914 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1915 | -C "found CID extension" \ |
| 1916 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1917 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1918 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1919 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1920 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1921 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1922 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1923 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1924 | 0 \ |
| 1925 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1926 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1927 | -c "client hello, adding CID extension" \ |
| 1928 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1929 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1930 | -s "server hello, adding CID extension" \ |
| 1931 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1932 | -c "Use of CID extension negotiated" \ |
| 1933 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1934 | -c "Copy CIDs into SSL transform" \ |
| 1935 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1936 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1937 | -s "Use of Connection ID has been negotiated" \ |
| 1938 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1939 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1940 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1941 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1942 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1943 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1944 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1945 | 0 \ |
| 1946 | -c "Enable use of CID extension." \ |
| 1947 | -s "Enable use of CID extension." \ |
| 1948 | -c "client hello, adding CID extension" \ |
| 1949 | -s "found CID extension" \ |
| 1950 | -s "Use of CID extension negotiated" \ |
| 1951 | -s "server hello, adding CID extension" \ |
| 1952 | -c "found CID extension" \ |
| 1953 | -c "Use of CID extension negotiated" \ |
| 1954 | -s "Copy CIDs into SSL transform" \ |
| 1955 | -c "Copy CIDs into SSL transform" \ |
| 1956 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1957 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1958 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1959 | -c "Use of Connection ID has been negotiated" \ |
| 1960 | -c "ignoring unexpected CID" \ |
| 1961 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1962 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1963 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1964 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1965 | -p "$P_PXY mtu=800" \ |
| 1966 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1967 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1968 | 0 \ |
| 1969 | -c "Enable use of CID extension." \ |
| 1970 | -s "Enable use of CID extension." \ |
| 1971 | -c "client hello, adding CID extension" \ |
| 1972 | -s "found CID extension" \ |
| 1973 | -s "Use of CID extension negotiated" \ |
| 1974 | -s "server hello, adding CID extension" \ |
| 1975 | -c "found CID extension" \ |
| 1976 | -c "Use of CID extension negotiated" \ |
| 1977 | -s "Copy CIDs into SSL transform" \ |
| 1978 | -c "Copy CIDs into SSL transform" \ |
| 1979 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1980 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1981 | -s "Use of Connection ID has been negotiated" \ |
| 1982 | -c "Use of Connection ID has been negotiated" |
| 1983 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1984 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1985 | 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] | 1986 | -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] | 1987 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1988 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1989 | 0 \ |
| 1990 | -c "Enable use of CID extension." \ |
| 1991 | -s "Enable use of CID extension." \ |
| 1992 | -c "client hello, adding CID extension" \ |
| 1993 | -s "found CID extension" \ |
| 1994 | -s "Use of CID extension negotiated" \ |
| 1995 | -s "server hello, adding CID extension" \ |
| 1996 | -c "found CID extension" \ |
| 1997 | -c "Use of CID extension negotiated" \ |
| 1998 | -s "Copy CIDs into SSL transform" \ |
| 1999 | -c "Copy CIDs into SSL transform" \ |
| 2000 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2001 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2002 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2003 | -c "Use of Connection ID has been negotiated" \ |
| 2004 | -c "ignoring unexpected CID" \ |
| 2005 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2006 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2007 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2008 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2009 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2010 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2011 | 0 \ |
| 2012 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2013 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2014 | -c "client hello, adding CID extension" \ |
| 2015 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2016 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2017 | -s "server hello, adding CID extension" \ |
| 2018 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2019 | -c "Use of CID extension negotiated" \ |
| 2020 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2021 | -c "Copy CIDs into SSL transform" \ |
| 2022 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2023 | -s "Peer CID (length 0 Bytes):" \ |
| 2024 | -s "Use of Connection ID has been negotiated" \ |
| 2025 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2026 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2027 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2028 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2029 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2030 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2031 | 0 \ |
| 2032 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2033 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2034 | -c "client hello, adding CID extension" \ |
| 2035 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2036 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2037 | -s "server hello, adding CID extension" \ |
| 2038 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2039 | -c "Use of CID extension negotiated" \ |
| 2040 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2041 | -c "Copy CIDs into SSL transform" \ |
| 2042 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2043 | -c "Peer CID (length 0 Bytes):" \ |
| 2044 | -s "Use of Connection ID has been negotiated" \ |
| 2045 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2046 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2047 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2048 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2049 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2050 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2051 | 0 \ |
| 2052 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2053 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2054 | -c "client hello, adding CID extension" \ |
| 2055 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2056 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2057 | -s "server hello, adding CID extension" \ |
| 2058 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2059 | -c "Use of CID extension negotiated" \ |
| 2060 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2061 | -c "Copy CIDs into SSL transform" \ |
| 2062 | -S "Use of Connection ID has been negotiated" \ |
| 2063 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2064 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2065 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2066 | 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] | 2067 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2068 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2069 | 0 \ |
| 2070 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2071 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2072 | -c "client hello, adding CID extension" \ |
| 2073 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2074 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2075 | -s "server hello, adding CID extension" \ |
| 2076 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2077 | -c "Use of CID extension negotiated" \ |
| 2078 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2079 | -c "Copy CIDs into SSL transform" \ |
| 2080 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2081 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2082 | -s "Use of Connection ID has been negotiated" \ |
| 2083 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2084 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2085 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2086 | 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] | 2087 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2088 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2089 | 0 \ |
| 2090 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2091 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2092 | -c "client hello, adding CID extension" \ |
| 2093 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2094 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2095 | -s "server hello, adding CID extension" \ |
| 2096 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2097 | -c "Use of CID extension negotiated" \ |
| 2098 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2099 | -c "Copy CIDs into SSL transform" \ |
| 2100 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2101 | -s "Peer CID (length 0 Bytes):" \ |
| 2102 | -s "Use of Connection ID has been negotiated" \ |
| 2103 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2104 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2105 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2106 | 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] | 2107 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2108 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2109 | 0 \ |
| 2110 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2111 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2112 | -c "client hello, adding CID extension" \ |
| 2113 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2114 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2115 | -s "server hello, adding CID extension" \ |
| 2116 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2117 | -c "Use of CID extension negotiated" \ |
| 2118 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2119 | -c "Copy CIDs into SSL transform" \ |
| 2120 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2121 | -c "Peer CID (length 0 Bytes):" \ |
| 2122 | -s "Use of Connection ID has been negotiated" \ |
| 2123 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2124 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2125 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2126 | 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] | 2127 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2128 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2129 | 0 \ |
| 2130 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2131 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2132 | -c "client hello, adding CID extension" \ |
| 2133 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2134 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2135 | -s "server hello, adding CID extension" \ |
| 2136 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2137 | -c "Use of CID extension negotiated" \ |
| 2138 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2139 | -c "Copy CIDs into SSL transform" \ |
| 2140 | -S "Use of Connection ID has been negotiated" \ |
| 2141 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2142 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2143 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2144 | 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] | 2145 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2146 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2147 | 0 \ |
| 2148 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2149 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2150 | -c "client hello, adding CID extension" \ |
| 2151 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2152 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2153 | -s "server hello, adding CID extension" \ |
| 2154 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2155 | -c "Use of CID extension negotiated" \ |
| 2156 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2157 | -c "Copy CIDs into SSL transform" \ |
| 2158 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2159 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2160 | -s "Use of Connection ID has been negotiated" \ |
| 2161 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2162 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2163 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2164 | 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] | 2165 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2166 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2167 | 0 \ |
| 2168 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2169 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2170 | -c "client hello, adding CID extension" \ |
| 2171 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2172 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2173 | -s "server hello, adding CID extension" \ |
| 2174 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2175 | -c "Use of CID extension negotiated" \ |
| 2176 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2177 | -c "Copy CIDs into SSL transform" \ |
| 2178 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2179 | -s "Peer CID (length 0 Bytes):" \ |
| 2180 | -s "Use of Connection ID has been negotiated" \ |
| 2181 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2182 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2183 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2184 | 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] | 2185 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2186 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2187 | 0 \ |
| 2188 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2189 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2190 | -c "client hello, adding CID extension" \ |
| 2191 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2192 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2193 | -s "server hello, adding CID extension" \ |
| 2194 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2195 | -c "Use of CID extension negotiated" \ |
| 2196 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2197 | -c "Copy CIDs into SSL transform" \ |
| 2198 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2199 | -c "Peer CID (length 0 Bytes):" \ |
| 2200 | -s "Use of Connection ID has been negotiated" \ |
| 2201 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2202 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2203 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2204 | 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] | 2205 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2206 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2207 | 0 \ |
| 2208 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2209 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2210 | -c "client hello, adding CID extension" \ |
| 2211 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2212 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2213 | -s "server hello, adding CID extension" \ |
| 2214 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2215 | -c "Use of CID extension negotiated" \ |
| 2216 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2217 | -c "Copy CIDs into SSL transform" \ |
| 2218 | -S "Use of Connection ID has been negotiated" \ |
| 2219 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2220 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2221 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2222 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2223 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2224 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2225 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2226 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2227 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2228 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2229 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2230 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2231 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2232 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2233 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2234 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2235 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2236 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2237 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2238 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2239 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2240 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2241 | 0 \ |
| 2242 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2243 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2244 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2245 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2246 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2247 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2248 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2249 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2250 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2251 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2252 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2253 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2254 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2255 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2256 | 0 \ |
| 2257 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2258 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2259 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2260 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2261 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2262 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2263 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2264 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2265 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2266 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2267 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2268 | 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] | 2269 | -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] | 2270 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2271 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2272 | 0 \ |
| 2273 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2274 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2275 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2276 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2277 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2278 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2279 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2280 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2281 | -c "ignoring unexpected CID" \ |
| 2282 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2283 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2284 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2285 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2286 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2287 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2288 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2289 | 0 \ |
| 2290 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2291 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2292 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2293 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2294 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2295 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2296 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2297 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2298 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2299 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2300 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2301 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2302 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2303 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2304 | 0 \ |
| 2305 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2306 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2307 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2308 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2309 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2310 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2311 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2312 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2313 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2314 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2315 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2316 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2317 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2318 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2319 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2320 | 0 \ |
| 2321 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2322 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2323 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2324 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2325 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2326 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2327 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2328 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2329 | -c "ignoring unexpected CID" \ |
| 2330 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2331 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2332 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2333 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2334 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2335 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2336 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2337 | 0 \ |
| 2338 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2339 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2340 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2341 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2342 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2343 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2344 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2345 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2346 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2347 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2348 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2349 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2350 | 0 \ |
| 2351 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2352 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2353 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2354 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2355 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2356 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2357 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2358 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2359 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2360 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2361 | -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] | 2362 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2363 | "$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" \ |
| 2364 | 0 \ |
| 2365 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2366 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2367 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2368 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2369 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2370 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2371 | -c "ignoring unexpected CID" \ |
| 2372 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2373 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2374 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2375 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2376 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2377 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2378 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2379 | 0 \ |
| 2380 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2381 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2382 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2383 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2384 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2385 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2386 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2387 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2388 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2389 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2390 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2391 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2392 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2393 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2394 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2395 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2396 | 0 \ |
| 2397 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2398 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2399 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2400 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2401 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2402 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2403 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2404 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2405 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2406 | -c "ignoring unexpected CID" \ |
| 2407 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2408 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2409 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2410 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2411 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2412 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2413 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2414 | 0 \ |
| 2415 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2416 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2417 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2418 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2419 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2420 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2421 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2422 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2423 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2424 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2425 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2426 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2427 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2428 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2429 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2430 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2431 | 0 \ |
| 2432 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2433 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2434 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2435 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2436 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2437 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2438 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2439 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2440 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2441 | -c "ignoring unexpected CID" \ |
| 2442 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2443 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2444 | # 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] | 2445 | # tests check that the buffer contents are reallocated when the message is |
| 2446 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2447 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2448 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2449 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2450 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2451 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2452 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2453 | 0 \ |
| 2454 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2455 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2456 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2457 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2458 | -s "Reallocating in_buf" \ |
| 2459 | -s "Reallocating out_buf" |
| 2460 | |
| 2461 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2462 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2463 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2464 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2465 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2466 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2467 | 0 \ |
| 2468 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2469 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2470 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2471 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2472 | -s "Reallocating in_buf" \ |
| 2473 | -s "Reallocating out_buf" |
| 2474 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2475 | # Tests for Encrypt-then-MAC extension |
| 2476 | |
| 2477 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2478 | "$P_SRV debug_level=3 \ |
| 2479 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2480 | "$P_CLI debug_level=3" \ |
| 2481 | 0 \ |
| 2482 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2483 | -s "found encrypt then mac extension" \ |
| 2484 | -s "server hello, adding encrypt then mac extension" \ |
| 2485 | -c "found encrypt_then_mac extension" \ |
| 2486 | -c "using encrypt then mac" \ |
| 2487 | -s "using encrypt then mac" |
| 2488 | |
| 2489 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2490 | "$P_SRV debug_level=3 etm=0 \ |
| 2491 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2492 | "$P_CLI debug_level=3 etm=1" \ |
| 2493 | 0 \ |
| 2494 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2495 | -s "found encrypt then mac extension" \ |
| 2496 | -S "server hello, adding encrypt then mac extension" \ |
| 2497 | -C "found encrypt_then_mac extension" \ |
| 2498 | -C "using encrypt then mac" \ |
| 2499 | -S "using encrypt then mac" |
| 2500 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2501 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2502 | "$P_SRV debug_level=3 etm=1 \ |
| 2503 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2504 | "$P_CLI debug_level=3 etm=1" \ |
| 2505 | 0 \ |
| 2506 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2507 | -s "found encrypt then mac extension" \ |
| 2508 | -S "server hello, adding encrypt then mac extension" \ |
| 2509 | -C "found encrypt_then_mac extension" \ |
| 2510 | -C "using encrypt then mac" \ |
| 2511 | -S "using encrypt then mac" |
| 2512 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2513 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2514 | "$P_SRV debug_level=3 etm=1 \ |
| 2515 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2516 | "$P_CLI debug_level=3 etm=0" \ |
| 2517 | 0 \ |
| 2518 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2519 | -S "found encrypt then mac extension" \ |
| 2520 | -S "server hello, adding encrypt then mac extension" \ |
| 2521 | -C "found encrypt_then_mac extension" \ |
| 2522 | -C "using encrypt then mac" \ |
| 2523 | -S "using encrypt then mac" |
| 2524 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2525 | # Tests for Extended Master Secret extension |
| 2526 | |
| 2527 | run_test "Extended Master Secret: default" \ |
| 2528 | "$P_SRV debug_level=3" \ |
| 2529 | "$P_CLI debug_level=3" \ |
| 2530 | 0 \ |
| 2531 | -c "client hello, adding extended_master_secret extension" \ |
| 2532 | -s "found extended master secret extension" \ |
| 2533 | -s "server hello, adding extended master secret extension" \ |
| 2534 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2535 | -c "session hash for extended master secret" \ |
| 2536 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2537 | |
| 2538 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2539 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2540 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2541 | 0 \ |
| 2542 | -c "client hello, adding extended_master_secret extension" \ |
| 2543 | -s "found extended master secret extension" \ |
| 2544 | -S "server hello, adding extended master secret extension" \ |
| 2545 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2546 | -C "session hash for extended master secret" \ |
| 2547 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2548 | |
| 2549 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2550 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2551 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2552 | 0 \ |
| 2553 | -C "client hello, adding extended_master_secret extension" \ |
| 2554 | -S "found extended master secret extension" \ |
| 2555 | -S "server hello, adding extended master secret extension" \ |
| 2556 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2557 | -C "session hash for extended master secret" \ |
| 2558 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2559 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2560 | # Test sending and receiving empty application data records |
| 2561 | |
| 2562 | run_test "Encrypt then MAC: empty application data record" \ |
| 2563 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2564 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2565 | 0 \ |
| 2566 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2567 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2568 | -c "0 bytes written in 1 fragments" |
| 2569 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2570 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2571 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2572 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2573 | 0 \ |
| 2574 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2575 | -c "0 bytes written in 1 fragments" |
| 2576 | |
| 2577 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2578 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2579 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2580 | 0 \ |
| 2581 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2582 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2583 | -c "0 bytes written in 1 fragments" |
| 2584 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2585 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2586 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2587 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2588 | 0 \ |
| 2589 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2590 | -c "0 bytes written in 1 fragments" |
| 2591 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2592 | # Tests for CBC 1/n-1 record splitting |
| 2593 | |
| 2594 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2595 | "$P_SRV" \ |
| 2596 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2597 | request_size=123 force_version=tls1_2" \ |
| 2598 | 0 \ |
| 2599 | -s "Read from client: 123 bytes read" \ |
| 2600 | -S "Read from client: 1 bytes read" \ |
| 2601 | -S "122 bytes read" |
| 2602 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2603 | # Tests for Session Tickets |
| 2604 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2605 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2606 | "$P_SRV debug_level=3 tickets=1" \ |
| 2607 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2608 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2609 | -c "client hello, adding session ticket extension" \ |
| 2610 | -s "found session ticket extension" \ |
| 2611 | -s "server hello, adding session ticket extension" \ |
| 2612 | -c "found session_ticket extension" \ |
| 2613 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2614 | -S "session successfully restored from cache" \ |
| 2615 | -s "session successfully restored from ticket" \ |
| 2616 | -s "a session has been resumed" \ |
| 2617 | -c "a session has been resumed" |
| 2618 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2619 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2620 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2621 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2622 | 0 \ |
| 2623 | -c "client hello, adding session ticket extension" \ |
| 2624 | -s "found session ticket extension" \ |
| 2625 | -s "server hello, adding session ticket extension" \ |
| 2626 | -c "found session_ticket extension" \ |
| 2627 | -c "parse new session ticket" \ |
| 2628 | -S "session successfully restored from cache" \ |
| 2629 | -s "session successfully restored from ticket" \ |
| 2630 | -s "a session has been resumed" \ |
| 2631 | -c "a session has been resumed" |
| 2632 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2633 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2634 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2635 | "$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] | 2636 | 0 \ |
| 2637 | -c "client hello, adding session ticket extension" \ |
| 2638 | -s "found session ticket extension" \ |
| 2639 | -s "server hello, adding session ticket extension" \ |
| 2640 | -c "found session_ticket extension" \ |
| 2641 | -c "parse new session ticket" \ |
| 2642 | -S "session successfully restored from cache" \ |
| 2643 | -S "session successfully restored from ticket" \ |
| 2644 | -S "a session has been resumed" \ |
| 2645 | -C "a session has been resumed" |
| 2646 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2647 | run_test "Session resume using tickets: session copy" \ |
| 2648 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2649 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2650 | 0 \ |
| 2651 | -c "client hello, adding session ticket extension" \ |
| 2652 | -s "found session ticket extension" \ |
| 2653 | -s "server hello, adding session ticket extension" \ |
| 2654 | -c "found session_ticket extension" \ |
| 2655 | -c "parse new session ticket" \ |
| 2656 | -S "session successfully restored from cache" \ |
| 2657 | -s "session successfully restored from ticket" \ |
| 2658 | -s "a session has been resumed" \ |
| 2659 | -c "a session has been resumed" |
| 2660 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2661 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2662 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2663 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2664 | 0 \ |
| 2665 | -c "client hello, adding session ticket extension" \ |
| 2666 | -c "found session_ticket extension" \ |
| 2667 | -c "parse new session ticket" \ |
| 2668 | -c "a session has been resumed" |
| 2669 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2670 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2671 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2672 | "( $O_CLI -sess_out $SESSION; \ |
| 2673 | $O_CLI -sess_in $SESSION; \ |
| 2674 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2675 | 0 \ |
| 2676 | -s "found session ticket extension" \ |
| 2677 | -s "server hello, adding session ticket extension" \ |
| 2678 | -S "session successfully restored from cache" \ |
| 2679 | -s "session successfully restored from ticket" \ |
| 2680 | -s "a session has been resumed" |
| 2681 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2682 | # Tests for Session Tickets with DTLS |
| 2683 | |
| 2684 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2685 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2686 | "$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] | 2687 | 0 \ |
| 2688 | -c "client hello, adding session ticket extension" \ |
| 2689 | -s "found session ticket extension" \ |
| 2690 | -s "server hello, adding session ticket extension" \ |
| 2691 | -c "found session_ticket extension" \ |
| 2692 | -c "parse new session ticket" \ |
| 2693 | -S "session successfully restored from cache" \ |
| 2694 | -s "session successfully restored from ticket" \ |
| 2695 | -s "a session has been resumed" \ |
| 2696 | -c "a session has been resumed" |
| 2697 | |
| 2698 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2699 | "$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] | 2700 | "$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] | 2701 | 0 \ |
| 2702 | -c "client hello, adding session ticket extension" \ |
| 2703 | -s "found session ticket extension" \ |
| 2704 | -s "server hello, adding session ticket extension" \ |
| 2705 | -c "found session_ticket extension" \ |
| 2706 | -c "parse new session ticket" \ |
| 2707 | -S "session successfully restored from cache" \ |
| 2708 | -s "session successfully restored from ticket" \ |
| 2709 | -s "a session has been resumed" \ |
| 2710 | -c "a session has been resumed" |
| 2711 | |
| 2712 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2713 | "$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] | 2714 | "$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] | 2715 | 0 \ |
| 2716 | -c "client hello, adding session ticket extension" \ |
| 2717 | -s "found session ticket extension" \ |
| 2718 | -s "server hello, adding session ticket extension" \ |
| 2719 | -c "found session_ticket extension" \ |
| 2720 | -c "parse new session ticket" \ |
| 2721 | -S "session successfully restored from cache" \ |
| 2722 | -S "session successfully restored from ticket" \ |
| 2723 | -S "a session has been resumed" \ |
| 2724 | -C "a session has been resumed" |
| 2725 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2726 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2727 | "$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] | 2728 | "$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] | 2729 | 0 \ |
| 2730 | -c "client hello, adding session ticket extension" \ |
| 2731 | -s "found session ticket extension" \ |
| 2732 | -s "server hello, adding session ticket extension" \ |
| 2733 | -c "found session_ticket extension" \ |
| 2734 | -c "parse new session ticket" \ |
| 2735 | -S "session successfully restored from cache" \ |
| 2736 | -s "session successfully restored from ticket" \ |
| 2737 | -s "a session has been resumed" \ |
| 2738 | -c "a session has been resumed" |
| 2739 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2740 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2741 | "$O_SRV -dtls" \ |
| 2742 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2743 | 0 \ |
| 2744 | -c "client hello, adding session ticket extension" \ |
| 2745 | -c "found session_ticket extension" \ |
| 2746 | -c "parse new session ticket" \ |
| 2747 | -c "a session has been resumed" |
| 2748 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2749 | # 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] | 2750 | # 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] | 2751 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2752 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2753 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2754 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 2755 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2756 | rm -f $SESSION )" \ |
| 2757 | 0 \ |
| 2758 | -s "found session ticket extension" \ |
| 2759 | -s "server hello, adding session ticket extension" \ |
| 2760 | -S "session successfully restored from cache" \ |
| 2761 | -s "session successfully restored from ticket" \ |
| 2762 | -s "a session has been resumed" |
| 2763 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2764 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2765 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2766 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2767 | "$P_SRV debug_level=3 tickets=0" \ |
| 2768 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2769 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2770 | -c "client hello, adding session ticket extension" \ |
| 2771 | -s "found session ticket extension" \ |
| 2772 | -S "server hello, adding session ticket extension" \ |
| 2773 | -C "found session_ticket extension" \ |
| 2774 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2775 | -s "session successfully restored from cache" \ |
| 2776 | -S "session successfully restored from ticket" \ |
| 2777 | -s "a session has been resumed" \ |
| 2778 | -c "a session has been resumed" |
| 2779 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2780 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2781 | "$P_SRV debug_level=3 tickets=1" \ |
| 2782 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2783 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2784 | -C "client hello, adding session ticket extension" \ |
| 2785 | -S "found session ticket extension" \ |
| 2786 | -S "server hello, adding session ticket extension" \ |
| 2787 | -C "found session_ticket extension" \ |
| 2788 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2789 | -s "session successfully restored from cache" \ |
| 2790 | -S "session successfully restored from ticket" \ |
| 2791 | -s "a session has been resumed" \ |
| 2792 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2793 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2794 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2795 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2796 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2797 | 0 \ |
| 2798 | -S "session successfully restored from cache" \ |
| 2799 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2800 | -S "a session has been resumed" \ |
| 2801 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2802 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2803 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2804 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2805 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2806 | 0 \ |
| 2807 | -s "session successfully restored from cache" \ |
| 2808 | -S "session successfully restored from ticket" \ |
| 2809 | -s "a session has been resumed" \ |
| 2810 | -c "a session has been resumed" |
| 2811 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2812 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2813 | "$P_SRV debug_level=3 tickets=0" \ |
| 2814 | "$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] | 2815 | 0 \ |
| 2816 | -s "session successfully restored from cache" \ |
| 2817 | -S "session successfully restored from ticket" \ |
| 2818 | -s "a session has been resumed" \ |
| 2819 | -c "a session has been resumed" |
| 2820 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2821 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2822 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2823 | "$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] | 2824 | 0 \ |
| 2825 | -S "session successfully restored from cache" \ |
| 2826 | -S "session successfully restored from ticket" \ |
| 2827 | -S "a session has been resumed" \ |
| 2828 | -C "a session has been resumed" |
| 2829 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2830 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2831 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2832 | "$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] | 2833 | 0 \ |
| 2834 | -s "session successfully restored from cache" \ |
| 2835 | -S "session successfully restored from ticket" \ |
| 2836 | -s "a session has been resumed" \ |
| 2837 | -c "a session has been resumed" |
| 2838 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2839 | run_test "Session resume using cache: session copy" \ |
| 2840 | "$P_SRV debug_level=3 tickets=0" \ |
| 2841 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2842 | 0 \ |
| 2843 | -s "session successfully restored from cache" \ |
| 2844 | -S "session successfully restored from ticket" \ |
| 2845 | -s "a session has been resumed" \ |
| 2846 | -c "a session has been resumed" |
| 2847 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2848 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2849 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2850 | "( $O_CLI -sess_out $SESSION; \ |
| 2851 | $O_CLI -sess_in $SESSION; \ |
| 2852 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2853 | 0 \ |
| 2854 | -s "found session ticket extension" \ |
| 2855 | -S "server hello, adding session ticket extension" \ |
| 2856 | -s "session successfully restored from cache" \ |
| 2857 | -S "session successfully restored from ticket" \ |
| 2858 | -s "a session has been resumed" |
| 2859 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2860 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2861 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2862 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2863 | 0 \ |
| 2864 | -C "found session_ticket extension" \ |
| 2865 | -C "parse new session ticket" \ |
| 2866 | -c "a session has been resumed" |
| 2867 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2868 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2869 | |
| 2870 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2871 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2872 | "$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] | 2873 | 0 \ |
| 2874 | -c "client hello, adding session ticket extension" \ |
| 2875 | -s "found session ticket extension" \ |
| 2876 | -S "server hello, adding session ticket extension" \ |
| 2877 | -C "found session_ticket extension" \ |
| 2878 | -C "parse new session ticket" \ |
| 2879 | -s "session successfully restored from cache" \ |
| 2880 | -S "session successfully restored from ticket" \ |
| 2881 | -s "a session has been resumed" \ |
| 2882 | -c "a session has been resumed" |
| 2883 | |
| 2884 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2885 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2886 | "$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] | 2887 | 0 \ |
| 2888 | -C "client hello, adding session ticket extension" \ |
| 2889 | -S "found session ticket extension" \ |
| 2890 | -S "server hello, adding session ticket extension" \ |
| 2891 | -C "found session_ticket extension" \ |
| 2892 | -C "parse new session ticket" \ |
| 2893 | -s "session successfully restored from cache" \ |
| 2894 | -S "session successfully restored from ticket" \ |
| 2895 | -s "a session has been resumed" \ |
| 2896 | -c "a session has been resumed" |
| 2897 | |
| 2898 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2899 | "$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] | 2900 | "$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] | 2901 | 0 \ |
| 2902 | -S "session successfully restored from cache" \ |
| 2903 | -S "session successfully restored from ticket" \ |
| 2904 | -S "a session has been resumed" \ |
| 2905 | -C "a session has been resumed" |
| 2906 | |
| 2907 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2908 | "$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] | 2909 | "$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] | 2910 | 0 \ |
| 2911 | -s "session successfully restored from cache" \ |
| 2912 | -S "session successfully restored from ticket" \ |
| 2913 | -s "a session has been resumed" \ |
| 2914 | -c "a session has been resumed" |
| 2915 | |
| 2916 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2917 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2918 | "$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] | 2919 | 0 \ |
| 2920 | -s "session successfully restored from cache" \ |
| 2921 | -S "session successfully restored from ticket" \ |
| 2922 | -s "a session has been resumed" \ |
| 2923 | -c "a session has been resumed" |
| 2924 | |
| 2925 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2926 | "$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] | 2927 | "$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] | 2928 | 0 \ |
| 2929 | -S "session successfully restored from cache" \ |
| 2930 | -S "session successfully restored from ticket" \ |
| 2931 | -S "a session has been resumed" \ |
| 2932 | -C "a session has been resumed" |
| 2933 | |
| 2934 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2935 | "$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] | 2936 | "$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] | 2937 | 0 \ |
| 2938 | -s "session successfully restored from cache" \ |
| 2939 | -S "session successfully restored from ticket" \ |
| 2940 | -s "a session has been resumed" \ |
| 2941 | -c "a session has been resumed" |
| 2942 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2943 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2944 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2945 | "$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] | 2946 | 0 \ |
| 2947 | -s "session successfully restored from cache" \ |
| 2948 | -S "session successfully restored from ticket" \ |
| 2949 | -s "a session has been resumed" \ |
| 2950 | -c "a session has been resumed" |
| 2951 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2952 | # 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] | 2953 | # 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] | 2954 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2955 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2956 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2957 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 2958 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2959 | rm -f $SESSION )" \ |
| 2960 | 0 \ |
| 2961 | -s "found session ticket extension" \ |
| 2962 | -S "server hello, adding session ticket extension" \ |
| 2963 | -s "session successfully restored from cache" \ |
| 2964 | -S "session successfully restored from ticket" \ |
| 2965 | -s "a session has been resumed" |
| 2966 | |
| 2967 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2968 | "$O_SRV -dtls" \ |
| 2969 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2970 | 0 \ |
| 2971 | -C "found session_ticket extension" \ |
| 2972 | -C "parse new session ticket" \ |
| 2973 | -c "a session has been resumed" |
| 2974 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2975 | # Tests for Max Fragment Length extension |
| 2976 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2977 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2978 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2979 | "$P_SRV debug_level=3" \ |
| 2980 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2981 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2982 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2983 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2984 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2985 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2986 | -C "client hello, adding max_fragment_length extension" \ |
| 2987 | -S "found max fragment length extension" \ |
| 2988 | -S "server hello, max_fragment_length extension" \ |
| 2989 | -C "found max_fragment_length extension" |
| 2990 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2991 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2992 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2993 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2994 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2995 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2996 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2997 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2998 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2999 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3000 | -C "client hello, adding max_fragment_length extension" \ |
| 3001 | -S "found max fragment length extension" \ |
| 3002 | -S "server hello, max_fragment_length extension" \ |
| 3003 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3004 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3005 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3006 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3007 | |
| 3008 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3009 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3010 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3011 | "$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] | 3012 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3013 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3014 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3015 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3016 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3017 | -C "client hello, adding max_fragment_length extension" \ |
| 3018 | -S "found max fragment length extension" \ |
| 3019 | -S "server hello, max_fragment_length extension" \ |
| 3020 | -C "found max_fragment_length extension" \ |
| 3021 | -c "fragment larger than.*maximum " |
| 3022 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3023 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3024 | # (session fragment length will be 16384 regardless of mbedtls |
| 3025 | # content length configuration.) |
| 3026 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3027 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3028 | run_test "Max fragment length: disabled, larger message" \ |
| 3029 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3030 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3031 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3032 | -C "Maximum incoming record payload length is 16384" \ |
| 3033 | -C "Maximum outgoing record payload length is 16384" \ |
| 3034 | -S "Maximum incoming record payload length is 16384" \ |
| 3035 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3036 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3037 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3038 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3039 | |
| 3040 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3041 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3042 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3043 | "$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] | 3044 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3045 | -C "Maximum incoming record payload length is 16384" \ |
| 3046 | -C "Maximum outgoing record payload length is 16384" \ |
| 3047 | -S "Maximum incoming record payload length is 16384" \ |
| 3048 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3049 | -c "fragment larger than.*maximum " |
| 3050 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3051 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3052 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3053 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3054 | "$P_SRV debug_level=3" \ |
| 3055 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3056 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3057 | -c "Maximum incoming record payload length is 4096" \ |
| 3058 | -c "Maximum outgoing record payload length is 4096" \ |
| 3059 | -s "Maximum incoming record payload length is 4096" \ |
| 3060 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3061 | -c "client hello, adding max_fragment_length extension" \ |
| 3062 | -s "found max fragment length extension" \ |
| 3063 | -s "server hello, max_fragment_length extension" \ |
| 3064 | -c "found max_fragment_length extension" |
| 3065 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3066 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3067 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3068 | run_test "Max fragment length: client 512, server 1024" \ |
| 3069 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3070 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3071 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3072 | -c "Maximum incoming record payload length is 512" \ |
| 3073 | -c "Maximum outgoing record payload length is 512" \ |
| 3074 | -s "Maximum incoming record payload length is 512" \ |
| 3075 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3076 | -c "client hello, adding max_fragment_length extension" \ |
| 3077 | -s "found max fragment length extension" \ |
| 3078 | -s "server hello, max_fragment_length extension" \ |
| 3079 | -c "found max_fragment_length extension" |
| 3080 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3081 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3082 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3083 | run_test "Max fragment length: client 512, server 2048" \ |
| 3084 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3085 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3086 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3087 | -c "Maximum incoming record payload length is 512" \ |
| 3088 | -c "Maximum outgoing record payload length is 512" \ |
| 3089 | -s "Maximum incoming record payload length is 512" \ |
| 3090 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3091 | -c "client hello, adding max_fragment_length extension" \ |
| 3092 | -s "found max fragment length extension" \ |
| 3093 | -s "server hello, max_fragment_length extension" \ |
| 3094 | -c "found max_fragment_length extension" |
| 3095 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3096 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3097 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3098 | run_test "Max fragment length: client 512, server 4096" \ |
| 3099 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3100 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3101 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3102 | -c "Maximum incoming record payload length is 512" \ |
| 3103 | -c "Maximum outgoing record payload length is 512" \ |
| 3104 | -s "Maximum incoming record payload length is 512" \ |
| 3105 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3106 | -c "client hello, adding max_fragment_length extension" \ |
| 3107 | -s "found max fragment length extension" \ |
| 3108 | -s "server hello, max_fragment_length extension" \ |
| 3109 | -c "found max_fragment_length extension" |
| 3110 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3111 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3112 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3113 | run_test "Max fragment length: client 1024, server 512" \ |
| 3114 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3115 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3116 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3117 | -c "Maximum incoming record payload length is 1024" \ |
| 3118 | -c "Maximum outgoing record payload length is 1024" \ |
| 3119 | -s "Maximum incoming record payload length is 1024" \ |
| 3120 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3121 | -c "client hello, adding max_fragment_length extension" \ |
| 3122 | -s "found max fragment length extension" \ |
| 3123 | -s "server hello, max_fragment_length extension" \ |
| 3124 | -c "found max_fragment_length extension" |
| 3125 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3126 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3127 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3128 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3129 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3130 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3131 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3132 | -c "Maximum incoming record payload length is 1024" \ |
| 3133 | -c "Maximum outgoing record payload length is 1024" \ |
| 3134 | -s "Maximum incoming record payload length is 1024" \ |
| 3135 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3136 | -c "client hello, adding max_fragment_length extension" \ |
| 3137 | -s "found max fragment length extension" \ |
| 3138 | -s "server hello, max_fragment_length extension" \ |
| 3139 | -c "found max_fragment_length extension" |
| 3140 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3141 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3142 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3143 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3144 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3145 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3146 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3147 | -c "Maximum incoming record payload length is 1024" \ |
| 3148 | -c "Maximum outgoing record payload length is 1024" \ |
| 3149 | -s "Maximum incoming record payload length is 1024" \ |
| 3150 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3151 | -c "client hello, adding max_fragment_length extension" \ |
| 3152 | -s "found max fragment length extension" \ |
| 3153 | -s "server hello, max_fragment_length extension" \ |
| 3154 | -c "found max_fragment_length extension" |
| 3155 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3156 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3157 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3158 | run_test "Max fragment length: client 2048, server 512" \ |
| 3159 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3160 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3161 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3162 | -c "Maximum incoming record payload length is 2048" \ |
| 3163 | -c "Maximum outgoing record payload length is 2048" \ |
| 3164 | -s "Maximum incoming record payload length is 2048" \ |
| 3165 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3166 | -c "client hello, adding max_fragment_length extension" \ |
| 3167 | -s "found max fragment length extension" \ |
| 3168 | -s "server hello, max_fragment_length extension" \ |
| 3169 | -c "found max_fragment_length extension" |
| 3170 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3171 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3172 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3173 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3174 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3175 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3176 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3177 | -c "Maximum incoming record payload length is 2048" \ |
| 3178 | -c "Maximum outgoing record payload length is 2048" \ |
| 3179 | -s "Maximum incoming record payload length is 2048" \ |
| 3180 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3181 | -c "client hello, adding max_fragment_length extension" \ |
| 3182 | -s "found max fragment length extension" \ |
| 3183 | -s "server hello, max_fragment_length extension" \ |
| 3184 | -c "found max_fragment_length extension" |
| 3185 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3186 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3187 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3188 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3189 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3190 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3191 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3192 | -c "Maximum incoming record payload length is 2048" \ |
| 3193 | -c "Maximum outgoing record payload length is 2048" \ |
| 3194 | -s "Maximum incoming record payload length is 2048" \ |
| 3195 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3196 | -c "client hello, adding max_fragment_length extension" \ |
| 3197 | -s "found max fragment length extension" \ |
| 3198 | -s "server hello, max_fragment_length extension" \ |
| 3199 | -c "found max_fragment_length extension" |
| 3200 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3201 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3202 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3203 | run_test "Max fragment length: client 4096, server 512" \ |
| 3204 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3205 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3206 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3207 | -c "Maximum incoming record payload length is 4096" \ |
| 3208 | -c "Maximum outgoing record payload length is 4096" \ |
| 3209 | -s "Maximum incoming record payload length is 4096" \ |
| 3210 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3211 | -c "client hello, adding max_fragment_length extension" \ |
| 3212 | -s "found max fragment length extension" \ |
| 3213 | -s "server hello, max_fragment_length extension" \ |
| 3214 | -c "found max_fragment_length extension" |
| 3215 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3216 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3217 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3218 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3219 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3220 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3221 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3222 | -c "Maximum incoming record payload length is 4096" \ |
| 3223 | -c "Maximum outgoing record payload length is 4096" \ |
| 3224 | -s "Maximum incoming record payload length is 4096" \ |
| 3225 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3226 | -c "client hello, adding max_fragment_length extension" \ |
| 3227 | -s "found max fragment length extension" \ |
| 3228 | -s "server hello, max_fragment_length extension" \ |
| 3229 | -c "found max_fragment_length extension" |
| 3230 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3231 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3232 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3233 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3234 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3235 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3236 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3237 | -c "Maximum incoming record payload length is 4096" \ |
| 3238 | -c "Maximum outgoing record payload length is 4096" \ |
| 3239 | -s "Maximum incoming record payload length is 4096" \ |
| 3240 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3241 | -c "client hello, adding max_fragment_length extension" \ |
| 3242 | -s "found max fragment length extension" \ |
| 3243 | -s "server hello, max_fragment_length extension" \ |
| 3244 | -c "found max_fragment_length extension" |
| 3245 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3246 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3247 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3248 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3249 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3250 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3251 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3252 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3253 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3254 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3255 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3256 | -C "client hello, adding max_fragment_length extension" \ |
| 3257 | -S "found max fragment length extension" \ |
| 3258 | -S "server hello, max_fragment_length extension" \ |
| 3259 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3260 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3261 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3262 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3263 | requires_gnutls |
| 3264 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3265 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3266 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3267 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3268 | -c "Maximum incoming record payload length is 4096" \ |
| 3269 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3270 | -c "client hello, adding max_fragment_length extension" \ |
| 3271 | -c "found max_fragment_length extension" |
| 3272 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3273 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3274 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3275 | run_test "Max fragment length: client, message just fits" \ |
| 3276 | "$P_SRV debug_level=3" \ |
| 3277 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3278 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3279 | -c "Maximum incoming record payload length is 2048" \ |
| 3280 | -c "Maximum outgoing record payload length is 2048" \ |
| 3281 | -s "Maximum incoming record payload length is 2048" \ |
| 3282 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3283 | -c "client hello, adding max_fragment_length extension" \ |
| 3284 | -s "found max fragment length extension" \ |
| 3285 | -s "server hello, max_fragment_length extension" \ |
| 3286 | -c "found max_fragment_length extension" \ |
| 3287 | -c "2048 bytes written in 1 fragments" \ |
| 3288 | -s "2048 bytes read" |
| 3289 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3290 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3291 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3292 | run_test "Max fragment length: client, larger message" \ |
| 3293 | "$P_SRV debug_level=3" \ |
| 3294 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3295 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3296 | -c "Maximum incoming record payload length is 2048" \ |
| 3297 | -c "Maximum outgoing record payload length is 2048" \ |
| 3298 | -s "Maximum incoming record payload length is 2048" \ |
| 3299 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3300 | -c "client hello, adding max_fragment_length extension" \ |
| 3301 | -s "found max fragment length extension" \ |
| 3302 | -s "server hello, max_fragment_length extension" \ |
| 3303 | -c "found max_fragment_length extension" \ |
| 3304 | -c "2345 bytes written in 2 fragments" \ |
| 3305 | -s "2048 bytes read" \ |
| 3306 | -s "297 bytes read" |
| 3307 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3308 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3309 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3310 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3311 | "$P_SRV debug_level=3 dtls=1" \ |
| 3312 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3313 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3314 | -c "Maximum incoming record payload length is 2048" \ |
| 3315 | -c "Maximum outgoing record payload length is 2048" \ |
| 3316 | -s "Maximum incoming record payload length is 2048" \ |
| 3317 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3318 | -c "client hello, adding max_fragment_length extension" \ |
| 3319 | -s "found max fragment length extension" \ |
| 3320 | -s "server hello, max_fragment_length extension" \ |
| 3321 | -c "found max_fragment_length extension" \ |
| 3322 | -c "fragment larger than.*maximum" |
| 3323 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3324 | # Tests for renegotiation |
| 3325 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3326 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3327 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3328 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3329 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3330 | 0 \ |
| 3331 | -C "client hello, adding renegotiation extension" \ |
| 3332 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3333 | -S "found renegotiation extension" \ |
| 3334 | -s "server hello, secure renegotiation extension" \ |
| 3335 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3336 | -C "=> renegotiate" \ |
| 3337 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3338 | -S "write hello request" |
| 3339 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3340 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3341 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3342 | "$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] | 3343 | "$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] | 3344 | 0 \ |
| 3345 | -c "client hello, adding renegotiation extension" \ |
| 3346 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3347 | -s "found renegotiation extension" \ |
| 3348 | -s "server hello, secure renegotiation extension" \ |
| 3349 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3350 | -c "=> renegotiate" \ |
| 3351 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3352 | -S "write hello request" |
| 3353 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3354 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3355 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3356 | "$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] | 3357 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3358 | 0 \ |
| 3359 | -c "client hello, adding renegotiation extension" \ |
| 3360 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3361 | -s "found renegotiation extension" \ |
| 3362 | -s "server hello, secure renegotiation extension" \ |
| 3363 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3364 | -c "=> renegotiate" \ |
| 3365 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3366 | -s "write hello request" |
| 3367 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3368 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3369 | # 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] | 3370 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3371 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3372 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3373 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3374 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3375 | 0 \ |
| 3376 | -c "client hello, adding renegotiation extension" \ |
| 3377 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3378 | -s "found renegotiation extension" \ |
| 3379 | -s "server hello, secure renegotiation extension" \ |
| 3380 | -c "found renegotiation extension" \ |
| 3381 | -c "=> renegotiate" \ |
| 3382 | -s "=> renegotiate" \ |
| 3383 | -S "write hello request" \ |
| 3384 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3385 | |
| 3386 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3387 | # 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] | 3388 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3389 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3390 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3391 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3392 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3393 | 0 \ |
| 3394 | -c "client hello, adding renegotiation extension" \ |
| 3395 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3396 | -s "found renegotiation extension" \ |
| 3397 | -s "server hello, secure renegotiation extension" \ |
| 3398 | -c "found renegotiation extension" \ |
| 3399 | -c "=> renegotiate" \ |
| 3400 | -s "=> renegotiate" \ |
| 3401 | -s "write hello request" \ |
| 3402 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3403 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3404 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3405 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3406 | "$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] | 3407 | "$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] | 3408 | 0 \ |
| 3409 | -c "client hello, adding renegotiation extension" \ |
| 3410 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3411 | -s "found renegotiation extension" \ |
| 3412 | -s "server hello, secure renegotiation extension" \ |
| 3413 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3414 | -c "=> renegotiate" \ |
| 3415 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3416 | -s "write hello request" |
| 3417 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3418 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3419 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3420 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3421 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3422 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3423 | "$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" \ |
| 3424 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3425 | -c "Maximum incoming record payload length is 2048" \ |
| 3426 | -c "Maximum outgoing record payload length is 2048" \ |
| 3427 | -s "Maximum incoming record payload length is 2048" \ |
| 3428 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3429 | -c "client hello, adding max_fragment_length extension" \ |
| 3430 | -s "found max fragment length extension" \ |
| 3431 | -s "server hello, max_fragment_length extension" \ |
| 3432 | -c "found max_fragment_length extension" \ |
| 3433 | -c "client hello, adding renegotiation extension" \ |
| 3434 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3435 | -s "found renegotiation extension" \ |
| 3436 | -s "server hello, secure renegotiation extension" \ |
| 3437 | -c "found renegotiation extension" \ |
| 3438 | -c "=> renegotiate" \ |
| 3439 | -s "=> renegotiate" \ |
| 3440 | -s "write hello request" |
| 3441 | |
| 3442 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3443 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3444 | "$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] | 3445 | "$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] | 3446 | 1 \ |
| 3447 | -c "client hello, adding renegotiation extension" \ |
| 3448 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3449 | -S "found renegotiation extension" \ |
| 3450 | -s "server hello, secure renegotiation extension" \ |
| 3451 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3452 | -c "=> renegotiate" \ |
| 3453 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3454 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3455 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3456 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3457 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3458 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3459 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3460 | "$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] | 3461 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3462 | 0 \ |
| 3463 | -C "client hello, adding renegotiation extension" \ |
| 3464 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3465 | -S "found renegotiation extension" \ |
| 3466 | -s "server hello, secure renegotiation extension" \ |
| 3467 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3468 | -C "=> renegotiate" \ |
| 3469 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3470 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3471 | -S "SSL - An unexpected message was received from our peer" \ |
| 3472 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3473 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3474 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3475 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3476 | "$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] | 3477 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3478 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3479 | 0 \ |
| 3480 | -C "client hello, adding renegotiation extension" \ |
| 3481 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3482 | -S "found renegotiation extension" \ |
| 3483 | -s "server hello, secure renegotiation extension" \ |
| 3484 | -c "found renegotiation extension" \ |
| 3485 | -C "=> renegotiate" \ |
| 3486 | -S "=> renegotiate" \ |
| 3487 | -s "write hello request" \ |
| 3488 | -S "SSL - An unexpected message was received from our peer" \ |
| 3489 | -S "failed" |
| 3490 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3491 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3492 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3493 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3494 | "$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] | 3495 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3496 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3497 | 0 \ |
| 3498 | -C "client hello, adding renegotiation extension" \ |
| 3499 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3500 | -S "found renegotiation extension" \ |
| 3501 | -s "server hello, secure renegotiation extension" \ |
| 3502 | -c "found renegotiation extension" \ |
| 3503 | -C "=> renegotiate" \ |
| 3504 | -S "=> renegotiate" \ |
| 3505 | -s "write hello request" \ |
| 3506 | -S "SSL - An unexpected message was received from our peer" \ |
| 3507 | -S "failed" |
| 3508 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3509 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3510 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3511 | "$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] | 3512 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3513 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3514 | 0 \ |
| 3515 | -C "client hello, adding renegotiation extension" \ |
| 3516 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3517 | -S "found renegotiation extension" \ |
| 3518 | -s "server hello, secure renegotiation extension" \ |
| 3519 | -c "found renegotiation extension" \ |
| 3520 | -C "=> renegotiate" \ |
| 3521 | -S "=> renegotiate" \ |
| 3522 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3523 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3524 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3525 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3526 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3527 | "$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] | 3528 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3529 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3530 | 0 \ |
| 3531 | -c "client hello, adding renegotiation extension" \ |
| 3532 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3533 | -s "found renegotiation extension" \ |
| 3534 | -s "server hello, secure renegotiation extension" \ |
| 3535 | -c "found renegotiation extension" \ |
| 3536 | -c "=> renegotiate" \ |
| 3537 | -s "=> renegotiate" \ |
| 3538 | -s "write hello request" \ |
| 3539 | -S "SSL - An unexpected message was received from our peer" \ |
| 3540 | -S "failed" |
| 3541 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3542 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3543 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3544 | "$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] | 3545 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3546 | 0 \ |
| 3547 | -C "client hello, adding renegotiation extension" \ |
| 3548 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3549 | -S "found renegotiation extension" \ |
| 3550 | -s "server hello, secure renegotiation extension" \ |
| 3551 | -c "found renegotiation extension" \ |
| 3552 | -S "record counter limit reached: renegotiate" \ |
| 3553 | -C "=> renegotiate" \ |
| 3554 | -S "=> renegotiate" \ |
| 3555 | -S "write hello request" \ |
| 3556 | -S "SSL - An unexpected message was received from our peer" \ |
| 3557 | -S "failed" |
| 3558 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3559 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3560 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3561 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3562 | "$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] | 3563 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3564 | 0 \ |
| 3565 | -c "client hello, adding renegotiation extension" \ |
| 3566 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3567 | -s "found renegotiation extension" \ |
| 3568 | -s "server hello, secure renegotiation extension" \ |
| 3569 | -c "found renegotiation extension" \ |
| 3570 | -s "record counter limit reached: renegotiate" \ |
| 3571 | -c "=> renegotiate" \ |
| 3572 | -s "=> renegotiate" \ |
| 3573 | -s "write hello request" \ |
| 3574 | -S "SSL - An unexpected message was received from our peer" \ |
| 3575 | -S "failed" |
| 3576 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3577 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3578 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3579 | "$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] | 3580 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3581 | 0 \ |
| 3582 | -c "client hello, adding renegotiation extension" \ |
| 3583 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3584 | -s "found renegotiation extension" \ |
| 3585 | -s "server hello, secure renegotiation extension" \ |
| 3586 | -c "found renegotiation extension" \ |
| 3587 | -s "record counter limit reached: renegotiate" \ |
| 3588 | -c "=> renegotiate" \ |
| 3589 | -s "=> renegotiate" \ |
| 3590 | -s "write hello request" \ |
| 3591 | -S "SSL - An unexpected message was received from our peer" \ |
| 3592 | -S "failed" |
| 3593 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3594 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3595 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3596 | "$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] | 3597 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3598 | 0 \ |
| 3599 | -C "client hello, adding renegotiation extension" \ |
| 3600 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3601 | -S "found renegotiation extension" \ |
| 3602 | -s "server hello, secure renegotiation extension" \ |
| 3603 | -c "found renegotiation extension" \ |
| 3604 | -S "record counter limit reached: renegotiate" \ |
| 3605 | -C "=> renegotiate" \ |
| 3606 | -S "=> renegotiate" \ |
| 3607 | -S "write hello request" \ |
| 3608 | -S "SSL - An unexpected message was received from our peer" \ |
| 3609 | -S "failed" |
| 3610 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3611 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3612 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3613 | "$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] | 3614 | "$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] | 3615 | 0 \ |
| 3616 | -c "client hello, adding renegotiation extension" \ |
| 3617 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3618 | -s "found renegotiation extension" \ |
| 3619 | -s "server hello, secure renegotiation extension" \ |
| 3620 | -c "found renegotiation extension" \ |
| 3621 | -c "=> renegotiate" \ |
| 3622 | -s "=> renegotiate" \ |
| 3623 | -S "write hello request" |
| 3624 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3625 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3626 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3627 | "$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] | 3628 | "$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] | 3629 | 0 \ |
| 3630 | -c "client hello, adding renegotiation extension" \ |
| 3631 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3632 | -s "found renegotiation extension" \ |
| 3633 | -s "server hello, secure renegotiation extension" \ |
| 3634 | -c "found renegotiation extension" \ |
| 3635 | -c "=> renegotiate" \ |
| 3636 | -s "=> renegotiate" \ |
| 3637 | -s "write hello request" |
| 3638 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3639 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3640 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3641 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3642 | "$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] | 3643 | 0 \ |
| 3644 | -c "client hello, adding renegotiation extension" \ |
| 3645 | -c "found renegotiation extension" \ |
| 3646 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3647 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3648 | -C "error" \ |
| 3649 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3650 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3651 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3652 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3653 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3654 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3655 | "$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] | 3656 | 0 \ |
| 3657 | -c "client hello, adding renegotiation extension" \ |
| 3658 | -c "found renegotiation extension" \ |
| 3659 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3660 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3661 | -C "error" \ |
| 3662 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3663 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3664 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3665 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3666 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3667 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3668 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3669 | 1 \ |
| 3670 | -c "client hello, adding renegotiation extension" \ |
| 3671 | -C "found renegotiation extension" \ |
| 3672 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3673 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3674 | -c "error" \ |
| 3675 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3676 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3677 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3678 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3679 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3680 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3681 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3682 | allow_legacy=0" \ |
| 3683 | 1 \ |
| 3684 | -c "client hello, adding renegotiation extension" \ |
| 3685 | -C "found renegotiation extension" \ |
| 3686 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3687 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3688 | -c "error" \ |
| 3689 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3690 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3691 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3692 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3693 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3694 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3695 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3696 | allow_legacy=1" \ |
| 3697 | 0 \ |
| 3698 | -c "client hello, adding renegotiation extension" \ |
| 3699 | -C "found renegotiation extension" \ |
| 3700 | -c "=> renegotiate" \ |
| 3701 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3702 | -C "error" \ |
| 3703 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3704 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3705 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3706 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3707 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3708 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3709 | 0 \ |
| 3710 | -c "client hello, adding renegotiation extension" \ |
| 3711 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3712 | -s "found renegotiation extension" \ |
| 3713 | -s "server hello, secure renegotiation extension" \ |
| 3714 | -c "found renegotiation extension" \ |
| 3715 | -c "=> renegotiate" \ |
| 3716 | -s "=> renegotiate" \ |
| 3717 | -S "write hello request" |
| 3718 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3719 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3720 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3721 | "$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] | 3722 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3723 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3724 | 0 \ |
| 3725 | -c "client hello, adding renegotiation extension" \ |
| 3726 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3727 | -s "found renegotiation extension" \ |
| 3728 | -s "server hello, secure renegotiation extension" \ |
| 3729 | -c "found renegotiation extension" \ |
| 3730 | -c "=> renegotiate" \ |
| 3731 | -s "=> renegotiate" \ |
| 3732 | -s "write hello request" |
| 3733 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3734 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3735 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3736 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3737 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3738 | 0 \ |
| 3739 | -c "client hello, adding renegotiation extension" \ |
| 3740 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3741 | -s "found renegotiation extension" \ |
| 3742 | -s "server hello, secure renegotiation extension" \ |
| 3743 | -s "record counter limit reached: renegotiate" \ |
| 3744 | -c "=> renegotiate" \ |
| 3745 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3746 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3747 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3748 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3749 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3750 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3751 | "$G_SRV -u --mtu 4096" \ |
| 3752 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3753 | 0 \ |
| 3754 | -c "client hello, adding renegotiation extension" \ |
| 3755 | -c "found renegotiation extension" \ |
| 3756 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3757 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3758 | -C "error" \ |
| 3759 | -s "Extra-header:" |
| 3760 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3761 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3762 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3763 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3764 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3765 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3766 | "$P_CLI debug_level=3" \ |
| 3767 | 0 \ |
| 3768 | -c "found renegotiation extension" \ |
| 3769 | -C "error" \ |
| 3770 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3771 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3772 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3773 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3774 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3775 | "$P_CLI debug_level=3" \ |
| 3776 | 0 \ |
| 3777 | -C "found renegotiation extension" \ |
| 3778 | -C "error" \ |
| 3779 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3780 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3781 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3782 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3783 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3784 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3785 | 1 \ |
| 3786 | -C "found renegotiation extension" \ |
| 3787 | -c "error" \ |
| 3788 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3789 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3790 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3791 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3792 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3793 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3794 | 0 \ |
| 3795 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3796 | -s "server hello, secure renegotiation extension" |
| 3797 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3798 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3799 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3800 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3801 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3802 | 0 \ |
| 3803 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3804 | -S "server hello, secure renegotiation extension" |
| 3805 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3806 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3807 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3808 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3809 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3810 | 1 \ |
| 3811 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3812 | -S "server hello, secure renegotiation extension" |
| 3813 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3814 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3815 | |
| 3816 | requires_gnutls |
| 3817 | run_test "DER format: no trailing bytes" \ |
| 3818 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3819 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3820 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3821 | 0 \ |
| 3822 | -c "Handshake was completed" \ |
| 3823 | |
| 3824 | requires_gnutls |
| 3825 | run_test "DER format: with a trailing zero byte" \ |
| 3826 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3827 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3828 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3829 | 0 \ |
| 3830 | -c "Handshake was completed" \ |
| 3831 | |
| 3832 | requires_gnutls |
| 3833 | run_test "DER format: with a trailing random byte" \ |
| 3834 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3835 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3836 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3837 | 0 \ |
| 3838 | -c "Handshake was completed" \ |
| 3839 | |
| 3840 | requires_gnutls |
| 3841 | run_test "DER format: with 2 trailing random bytes" \ |
| 3842 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3843 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3844 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3845 | 0 \ |
| 3846 | -c "Handshake was completed" \ |
| 3847 | |
| 3848 | requires_gnutls |
| 3849 | run_test "DER format: with 4 trailing random bytes" \ |
| 3850 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3851 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3852 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3853 | 0 \ |
| 3854 | -c "Handshake was completed" \ |
| 3855 | |
| 3856 | requires_gnutls |
| 3857 | run_test "DER format: with 8 trailing random bytes" \ |
| 3858 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3859 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3860 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3861 | 0 \ |
| 3862 | -c "Handshake was completed" \ |
| 3863 | |
| 3864 | requires_gnutls |
| 3865 | run_test "DER format: with 9 trailing random bytes" \ |
| 3866 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3867 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3868 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3869 | 0 \ |
| 3870 | -c "Handshake was completed" \ |
| 3871 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3872 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3873 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3874 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3875 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3876 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3877 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3878 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3879 | 1 \ |
| 3880 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3881 | -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] | 3882 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3883 | -c "X509 - Certificate verification failed" |
| 3884 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3885 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3886 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3887 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3888 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3889 | 0 \ |
| 3890 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3891 | -c "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3892 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3893 | -C "X509 - Certificate verification failed" |
| 3894 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3895 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3896 | "$P_SRV" \ |
| 3897 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3898 | 0 \ |
| 3899 | -c "x509_verify_cert() returned" \ |
| 3900 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3901 | -c "! Certificate verification flags"\ |
| 3902 | -C "! mbedtls_ssl_handshake returned" \ |
| 3903 | -C "X509 - Certificate verification failed" \ |
| 3904 | -C "SSL - No CA Chain is set, but required to operate" |
| 3905 | |
| 3906 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3907 | "$P_SRV" \ |
| 3908 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3909 | 1 \ |
| 3910 | -c "x509_verify_cert() returned" \ |
| 3911 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3912 | -c "! Certificate verification flags"\ |
| 3913 | -c "! mbedtls_ssl_handshake returned" \ |
| 3914 | -c "SSL - No CA Chain is set, but required to operate" |
| 3915 | |
| 3916 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3917 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3918 | # the client informs the server about the supported curves - it does, though, in the |
| 3919 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3920 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3921 | # different means to have the server ignoring the client's supported curve list. |
| 3922 | |
| 3923 | requires_config_enabled MBEDTLS_ECP_C |
| 3924 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3925 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3926 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3927 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3928 | 1 \ |
| 3929 | -c "bad certificate (EC key curve)"\ |
| 3930 | -c "! Certificate verification flags"\ |
| 3931 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3932 | |
| 3933 | requires_config_enabled MBEDTLS_ECP_C |
| 3934 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3935 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3936 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3937 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3938 | 1 \ |
| 3939 | -c "bad certificate (EC key curve)"\ |
| 3940 | -c "! Certificate verification flags"\ |
| 3941 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3942 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3943 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3944 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3945 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3946 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3947 | 0 \ |
| 3948 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3949 | -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] | 3950 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3951 | -C "X509 - Certificate verification failed" |
| 3952 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3953 | run_test "Authentication: client SHA256, server required" \ |
| 3954 | "$P_SRV auth_mode=required" \ |
| 3955 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3956 | key_file=data_files/server6.key \ |
| 3957 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3958 | 0 \ |
| 3959 | -c "Supported Signature Algorithm found: 4," \ |
| 3960 | -c "Supported Signature Algorithm found: 5," |
| 3961 | |
| 3962 | run_test "Authentication: client SHA384, server required" \ |
| 3963 | "$P_SRV auth_mode=required" \ |
| 3964 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3965 | key_file=data_files/server6.key \ |
| 3966 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3967 | 0 \ |
| 3968 | -c "Supported Signature Algorithm found: 4," \ |
| 3969 | -c "Supported Signature Algorithm found: 5," |
| 3970 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3971 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3972 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3973 | "$P_CLI debug_level=3 crt_file=none \ |
| 3974 | key_file=data_files/server5.key" \ |
| 3975 | 1 \ |
| 3976 | -S "skip write certificate request" \ |
| 3977 | -C "skip parse certificate request" \ |
| 3978 | -c "got a certificate request" \ |
| 3979 | -c "= write certificate$" \ |
| 3980 | -C "skip write certificate$" \ |
| 3981 | -S "x509_verify_cert() returned" \ |
| 3982 | -s "client has no certificate" \ |
| 3983 | -s "! mbedtls_ssl_handshake returned" \ |
| 3984 | -c "! mbedtls_ssl_handshake returned" \ |
| 3985 | -s "No client certification received from the client, but required by the authentication mode" |
| 3986 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3987 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3988 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3989 | "$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] | 3990 | key_file=data_files/server5.key" \ |
| 3991 | 1 \ |
| 3992 | -S "skip write certificate request" \ |
| 3993 | -C "skip parse certificate request" \ |
| 3994 | -c "got a certificate request" \ |
| 3995 | -C "skip write certificate" \ |
| 3996 | -C "skip write certificate verify" \ |
| 3997 | -S "skip parse certificate verify" \ |
| 3998 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3999 | -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] | 4000 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4001 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4002 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4003 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4004 | # We don't check that the client receives the alert because it might |
| 4005 | # detect that its write end of the connection is closed and abort |
| 4006 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4007 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4008 | run_test "Authentication: client cert not trusted, server required" \ |
| 4009 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4010 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4011 | key_file=data_files/server5.key" \ |
| 4012 | 1 \ |
| 4013 | -S "skip write certificate request" \ |
| 4014 | -C "skip parse certificate request" \ |
| 4015 | -c "got a certificate request" \ |
| 4016 | -C "skip write certificate" \ |
| 4017 | -C "skip write certificate verify" \ |
| 4018 | -S "skip parse certificate verify" \ |
| 4019 | -s "x509_verify_cert() returned" \ |
| 4020 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4021 | -s "! mbedtls_ssl_handshake returned" \ |
| 4022 | -c "! mbedtls_ssl_handshake returned" \ |
| 4023 | -s "X509 - Certificate verification failed" |
| 4024 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4025 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4026 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4027 | "$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] | 4028 | key_file=data_files/server5.key" \ |
| 4029 | 0 \ |
| 4030 | -S "skip write certificate request" \ |
| 4031 | -C "skip parse certificate request" \ |
| 4032 | -c "got a certificate request" \ |
| 4033 | -C "skip write certificate" \ |
| 4034 | -C "skip write certificate verify" \ |
| 4035 | -S "skip parse certificate verify" \ |
| 4036 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4037 | -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] | 4038 | -S "! mbedtls_ssl_handshake returned" \ |
| 4039 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4040 | -S "X509 - Certificate verification failed" |
| 4041 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4042 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4043 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4044 | "$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] | 4045 | key_file=data_files/server5.key" \ |
| 4046 | 0 \ |
| 4047 | -s "skip write certificate request" \ |
| 4048 | -C "skip parse certificate request" \ |
| 4049 | -c "got no certificate request" \ |
| 4050 | -c "skip write certificate" \ |
| 4051 | -c "skip write certificate verify" \ |
| 4052 | -s "skip parse certificate verify" \ |
| 4053 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4054 | -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] | 4055 | -S "! mbedtls_ssl_handshake returned" \ |
| 4056 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4057 | -S "X509 - Certificate verification failed" |
| 4058 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4059 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4060 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4061 | "$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] | 4062 | 0 \ |
| 4063 | -S "skip write certificate request" \ |
| 4064 | -C "skip parse certificate request" \ |
| 4065 | -c "got a certificate request" \ |
| 4066 | -C "skip write certificate$" \ |
| 4067 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4068 | -c "skip write certificate verify" \ |
| 4069 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4070 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4071 | -S "! mbedtls_ssl_handshake returned" \ |
| 4072 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4073 | -S "X509 - Certificate verification failed" |
| 4074 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4075 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4076 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4077 | "$O_CLI" \ |
| 4078 | 0 \ |
| 4079 | -S "skip write certificate request" \ |
| 4080 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4081 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4082 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4083 | -S "X509 - Certificate verification failed" |
| 4084 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4085 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4086 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4087 | "$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] | 4088 | 0 \ |
| 4089 | -C "skip parse certificate request" \ |
| 4090 | -c "got a certificate request" \ |
| 4091 | -C "skip write certificate$" \ |
| 4092 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4093 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4094 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4095 | run_test "Authentication: client no cert, openssl server required" \ |
| 4096 | "$O_SRV -Verify 10" \ |
| 4097 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4098 | 1 \ |
| 4099 | -C "skip parse certificate request" \ |
| 4100 | -c "got a certificate request" \ |
| 4101 | -C "skip write certificate$" \ |
| 4102 | -c "skip write certificate verify" \ |
| 4103 | -c "! mbedtls_ssl_handshake returned" |
| 4104 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4105 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4106 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4107 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4108 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4109 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4110 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4111 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4112 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4113 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4114 | # 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] | 4115 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4116 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4117 | run_test "Authentication: server max_int chain, client default" \ |
| 4118 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4119 | key_file=data_files/dir-maxpath/09.key" \ |
| 4120 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4121 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4122 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4123 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4124 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4125 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4126 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4127 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4128 | key_file=data_files/dir-maxpath/10.key" \ |
| 4129 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4130 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4131 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4132 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4133 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4134 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4135 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4136 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4137 | key_file=data_files/dir-maxpath/10.key" \ |
| 4138 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4139 | auth_mode=optional" \ |
| 4140 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4141 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4142 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4143 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4144 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4145 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4146 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4147 | key_file=data_files/dir-maxpath/10.key" \ |
| 4148 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4149 | auth_mode=none" \ |
| 4150 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4151 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4152 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4153 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4154 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4155 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4156 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4157 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4158 | key_file=data_files/dir-maxpath/10.key" \ |
| 4159 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4160 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4161 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4162 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4163 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4164 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4165 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4166 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4167 | key_file=data_files/dir-maxpath/10.key" \ |
| 4168 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4169 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4170 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4171 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4172 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4173 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4174 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4175 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4176 | key_file=data_files/dir-maxpath/10.key" \ |
| 4177 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4178 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4179 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4180 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4181 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4182 | run_test "Authentication: client max_int chain, server required" \ |
| 4183 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4184 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4185 | key_file=data_files/dir-maxpath/09.key" \ |
| 4186 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4187 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4188 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4189 | # Tests for CA list in CertificateRequest messages |
| 4190 | |
| 4191 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4192 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4193 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4194 | key_file=data_files/server6.key" \ |
| 4195 | 0 \ |
| 4196 | -s "requested DN" |
| 4197 | |
| 4198 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4199 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4200 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4201 | key_file=data_files/server6.key" \ |
| 4202 | 0 \ |
| 4203 | -S "requested DN" |
| 4204 | |
| 4205 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4206 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4207 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4208 | key_file=data_files/server5.key" \ |
| 4209 | 1 \ |
| 4210 | -S "requested DN" \ |
| 4211 | -s "x509_verify_cert() returned" \ |
| 4212 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4213 | -s "! mbedtls_ssl_handshake returned" \ |
| 4214 | -c "! mbedtls_ssl_handshake returned" \ |
| 4215 | -s "X509 - Certificate verification failed" |
| 4216 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4217 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4218 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4219 | |
| 4220 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4221 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4222 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4223 | key_file=data_files/server5.key" \ |
| 4224 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4225 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4226 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4227 | -c "x509_verify_cert() returned" \ |
| 4228 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4229 | -c "! mbedtls_ssl_handshake returned" \ |
| 4230 | -c "X509 - Certificate verification failed" |
| 4231 | |
| 4232 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4233 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4234 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4235 | key_file=data_files/server5.key" \ |
| 4236 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4237 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4238 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4239 | -c "x509_verify_cert() returned" \ |
| 4240 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4241 | -C "! mbedtls_ssl_handshake returned" \ |
| 4242 | -C "X509 - Certificate verification failed" |
| 4243 | |
| 4244 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4245 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4246 | # the client informs the server about the supported curves - it does, though, in the |
| 4247 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4248 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4249 | # different means to have the server ignoring the client's supported curve list. |
| 4250 | |
| 4251 | requires_config_enabled MBEDTLS_ECP_C |
| 4252 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4253 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4254 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4255 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4256 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4257 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4258 | -c "use CA callback for X.509 CRT verification" \ |
| 4259 | -c "bad certificate (EC key curve)" \ |
| 4260 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4261 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4262 | |
| 4263 | requires_config_enabled MBEDTLS_ECP_C |
| 4264 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4265 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4266 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4267 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4268 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4269 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4270 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4271 | -c "bad certificate (EC key curve)"\ |
| 4272 | -c "! Certificate verification flags"\ |
| 4273 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4274 | |
| 4275 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4276 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4277 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4278 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4279 | key_file=data_files/server6.key \ |
| 4280 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4281 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4282 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4283 | -c "Supported Signature Algorithm found: 4," \ |
| 4284 | -c "Supported Signature Algorithm found: 5," |
| 4285 | |
| 4286 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4287 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4288 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4289 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4290 | key_file=data_files/server6.key \ |
| 4291 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4292 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4293 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4294 | -c "Supported Signature Algorithm found: 4," \ |
| 4295 | -c "Supported Signature Algorithm found: 5," |
| 4296 | |
| 4297 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4298 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4299 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4300 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4301 | key_file=data_files/server5.key" \ |
| 4302 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4303 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4304 | -S "skip write certificate request" \ |
| 4305 | -C "skip parse certificate request" \ |
| 4306 | -c "got a certificate request" \ |
| 4307 | -C "skip write certificate" \ |
| 4308 | -C "skip write certificate verify" \ |
| 4309 | -S "skip parse certificate verify" \ |
| 4310 | -s "x509_verify_cert() returned" \ |
| 4311 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4312 | -s "! mbedtls_ssl_handshake returned" \ |
| 4313 | -s "send alert level=2 message=48" \ |
| 4314 | -c "! mbedtls_ssl_handshake returned" \ |
| 4315 | -s "X509 - Certificate verification failed" |
| 4316 | # We don't check that the client receives the alert because it might |
| 4317 | # detect that its write end of the connection is closed and abort |
| 4318 | # before reading the alert message. |
| 4319 | |
| 4320 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4321 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4322 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4323 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4324 | key_file=data_files/server5.key" \ |
| 4325 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4326 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4327 | -S "skip write certificate request" \ |
| 4328 | -C "skip parse certificate request" \ |
| 4329 | -c "got a certificate request" \ |
| 4330 | -C "skip write certificate" \ |
| 4331 | -C "skip write certificate verify" \ |
| 4332 | -S "skip parse certificate verify" \ |
| 4333 | -s "x509_verify_cert() returned" \ |
| 4334 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4335 | -s "! mbedtls_ssl_handshake returned" \ |
| 4336 | -c "! mbedtls_ssl_handshake returned" \ |
| 4337 | -s "X509 - Certificate verification failed" |
| 4338 | |
| 4339 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4340 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4341 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4342 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4343 | key_file=data_files/server5.key" \ |
| 4344 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4345 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4346 | -S "skip write certificate request" \ |
| 4347 | -C "skip parse certificate request" \ |
| 4348 | -c "got a certificate request" \ |
| 4349 | -C "skip write certificate" \ |
| 4350 | -C "skip write certificate verify" \ |
| 4351 | -S "skip parse certificate verify" \ |
| 4352 | -s "x509_verify_cert() returned" \ |
| 4353 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4354 | -S "! mbedtls_ssl_handshake returned" \ |
| 4355 | -C "! mbedtls_ssl_handshake returned" \ |
| 4356 | -S "X509 - Certificate verification failed" |
| 4357 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4358 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4359 | requires_full_size_output_buffer |
| 4360 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4361 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4362 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4363 | key_file=data_files/dir-maxpath/09.key" \ |
| 4364 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4365 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4366 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4367 | -C "X509 - A fatal error occurred" |
| 4368 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4369 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4370 | requires_full_size_output_buffer |
| 4371 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4372 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4373 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4374 | key_file=data_files/dir-maxpath/10.key" \ |
| 4375 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4376 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4377 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4378 | -c "X509 - A fatal error occurred" |
| 4379 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4380 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4381 | requires_full_size_output_buffer |
| 4382 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4383 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4384 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4385 | key_file=data_files/dir-maxpath/10.key" \ |
| 4386 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4387 | debug_level=3 auth_mode=optional" \ |
| 4388 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4389 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4390 | -c "X509 - A fatal error occurred" |
| 4391 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4392 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4393 | requires_full_size_output_buffer |
| 4394 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4395 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4396 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4397 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4398 | key_file=data_files/dir-maxpath/10.key" \ |
| 4399 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4400 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4401 | -s "X509 - A fatal error occurred" |
| 4402 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4403 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4404 | requires_full_size_output_buffer |
| 4405 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4406 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4407 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4408 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4409 | key_file=data_files/dir-maxpath/10.key" \ |
| 4410 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4411 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4412 | -s "X509 - A fatal error occurred" |
| 4413 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4414 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4415 | requires_full_size_output_buffer |
| 4416 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4417 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4418 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4419 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4420 | key_file=data_files/dir-maxpath/09.key" \ |
| 4421 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4422 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4423 | -S "X509 - A fatal error occurred" |
| 4424 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4425 | # Tests for certificate selection based on SHA verson |
| 4426 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4427 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4428 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4429 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4430 | key_file=data_files/server5.key \ |
| 4431 | crt_file2=data_files/server5-sha1.crt \ |
| 4432 | key_file2=data_files/server5.key" \ |
| 4433 | "$P_CLI force_version=tls1_2" \ |
| 4434 | 0 \ |
| 4435 | -c "signed using.*ECDSA with SHA256" \ |
| 4436 | -C "signed using.*ECDSA with SHA1" |
| 4437 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4438 | # tests for SNI |
| 4439 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4440 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4441 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4442 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4443 | 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] | 4444 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4445 | 0 \ |
| 4446 | -S "parse ServerName extension" \ |
| 4447 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4448 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4449 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4450 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4451 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4452 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4453 | 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] | 4454 | 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] | 4455 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4456 | 0 \ |
| 4457 | -s "parse ServerName extension" \ |
| 4458 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4459 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4460 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4461 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4462 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4463 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4464 | 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] | 4465 | 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] | 4466 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4467 | 0 \ |
| 4468 | -s "parse ServerName extension" \ |
| 4469 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4470 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4471 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4472 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4473 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4474 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4475 | 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] | 4476 | 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] | 4477 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4478 | 1 \ |
| 4479 | -s "parse ServerName extension" \ |
| 4480 | -s "ssl_sni_wrapper() returned" \ |
| 4481 | -s "mbedtls_ssl_handshake returned" \ |
| 4482 | -c "mbedtls_ssl_handshake returned" \ |
| 4483 | -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] | 4484 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4485 | run_test "SNI: client auth no override: optional" \ |
| 4486 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4487 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4488 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4489 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4490 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4491 | -S "skip write certificate request" \ |
| 4492 | -C "skip parse certificate request" \ |
| 4493 | -c "got a certificate request" \ |
| 4494 | -C "skip write certificate" \ |
| 4495 | -C "skip write certificate verify" \ |
| 4496 | -S "skip parse certificate verify" |
| 4497 | |
| 4498 | run_test "SNI: client auth override: none -> optional" \ |
| 4499 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4500 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4501 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4502 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4503 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4504 | -S "skip write certificate request" \ |
| 4505 | -C "skip parse certificate request" \ |
| 4506 | -c "got a certificate request" \ |
| 4507 | -C "skip write certificate" \ |
| 4508 | -C "skip write certificate verify" \ |
| 4509 | -S "skip parse certificate verify" |
| 4510 | |
| 4511 | run_test "SNI: client auth override: optional -> none" \ |
| 4512 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4513 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4514 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4515 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4516 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4517 | -s "skip write certificate request" \ |
| 4518 | -C "skip parse certificate request" \ |
| 4519 | -c "got no certificate request" \ |
| 4520 | -c "skip write certificate" \ |
| 4521 | -c "skip write certificate verify" \ |
| 4522 | -s "skip parse certificate verify" |
| 4523 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4524 | run_test "SNI: CA no override" \ |
| 4525 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4526 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4527 | ca_file=data_files/test-ca.crt \ |
| 4528 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4529 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4530 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4531 | 1 \ |
| 4532 | -S "skip write certificate request" \ |
| 4533 | -C "skip parse certificate request" \ |
| 4534 | -c "got a certificate request" \ |
| 4535 | -C "skip write certificate" \ |
| 4536 | -C "skip write certificate verify" \ |
| 4537 | -S "skip parse certificate verify" \ |
| 4538 | -s "x509_verify_cert() returned" \ |
| 4539 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4540 | -S "The certificate has been revoked (is on a CRL)" |
| 4541 | |
| 4542 | run_test "SNI: CA override" \ |
| 4543 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4544 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4545 | ca_file=data_files/test-ca.crt \ |
| 4546 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4547 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4548 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4549 | 0 \ |
| 4550 | -S "skip write certificate request" \ |
| 4551 | -C "skip parse certificate request" \ |
| 4552 | -c "got a certificate request" \ |
| 4553 | -C "skip write certificate" \ |
| 4554 | -C "skip write certificate verify" \ |
| 4555 | -S "skip parse certificate verify" \ |
| 4556 | -S "x509_verify_cert() returned" \ |
| 4557 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4558 | -S "The certificate has been revoked (is on a CRL)" |
| 4559 | |
| 4560 | run_test "SNI: CA override with CRL" \ |
| 4561 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4562 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4563 | ca_file=data_files/test-ca.crt \ |
| 4564 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4565 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4566 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4567 | 1 \ |
| 4568 | -S "skip write certificate request" \ |
| 4569 | -C "skip parse certificate request" \ |
| 4570 | -c "got a certificate request" \ |
| 4571 | -C "skip write certificate" \ |
| 4572 | -C "skip write certificate verify" \ |
| 4573 | -S "skip parse certificate verify" \ |
| 4574 | -s "x509_verify_cert() returned" \ |
| 4575 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4576 | -s "The certificate has been revoked (is on a CRL)" |
| 4577 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4578 | # Tests for SNI and DTLS |
| 4579 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4580 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4581 | run_test "SNI: DTLS, no SNI callback" \ |
| 4582 | "$P_SRV debug_level=3 dtls=1 \ |
| 4583 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4584 | "$P_CLI server_name=localhost dtls=1" \ |
| 4585 | 0 \ |
| 4586 | -S "parse ServerName extension" \ |
| 4587 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4588 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4589 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4590 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4591 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4592 | "$P_SRV debug_level=3 dtls=1 \ |
| 4593 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4594 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4595 | "$P_CLI server_name=localhost dtls=1" \ |
| 4596 | 0 \ |
| 4597 | -s "parse ServerName extension" \ |
| 4598 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4599 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4600 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4601 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4602 | run_test "SNI: DTLS, matching cert 2" \ |
| 4603 | "$P_SRV debug_level=3 dtls=1 \ |
| 4604 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4605 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4606 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4607 | 0 \ |
| 4608 | -s "parse ServerName extension" \ |
| 4609 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4610 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4611 | |
| 4612 | run_test "SNI: DTLS, no matching cert" \ |
| 4613 | "$P_SRV debug_level=3 dtls=1 \ |
| 4614 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4615 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4616 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4617 | 1 \ |
| 4618 | -s "parse ServerName extension" \ |
| 4619 | -s "ssl_sni_wrapper() returned" \ |
| 4620 | -s "mbedtls_ssl_handshake returned" \ |
| 4621 | -c "mbedtls_ssl_handshake returned" \ |
| 4622 | -c "SSL - A fatal alert message was received from our peer" |
| 4623 | |
| 4624 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4625 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4626 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4627 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4628 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4629 | 0 \ |
| 4630 | -S "skip write certificate request" \ |
| 4631 | -C "skip parse certificate request" \ |
| 4632 | -c "got a certificate request" \ |
| 4633 | -C "skip write certificate" \ |
| 4634 | -C "skip write certificate verify" \ |
| 4635 | -S "skip parse certificate verify" |
| 4636 | |
| 4637 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4638 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4639 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4640 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4641 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4642 | 0 \ |
| 4643 | -S "skip write certificate request" \ |
| 4644 | -C "skip parse certificate request" \ |
| 4645 | -c "got a certificate request" \ |
| 4646 | -C "skip write certificate" \ |
| 4647 | -C "skip write certificate verify" \ |
| 4648 | -S "skip parse certificate verify" |
| 4649 | |
| 4650 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4651 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4652 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4653 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4654 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4655 | 0 \ |
| 4656 | -s "skip write certificate request" \ |
| 4657 | -C "skip parse certificate request" \ |
| 4658 | -c "got no certificate request" \ |
| 4659 | -c "skip write certificate" \ |
| 4660 | -c "skip write certificate verify" \ |
| 4661 | -s "skip parse certificate verify" |
| 4662 | |
| 4663 | run_test "SNI: DTLS, CA no override" \ |
| 4664 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4665 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4666 | ca_file=data_files/test-ca.crt \ |
| 4667 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4668 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4669 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4670 | 1 \ |
| 4671 | -S "skip write certificate request" \ |
| 4672 | -C "skip parse certificate request" \ |
| 4673 | -c "got a certificate request" \ |
| 4674 | -C "skip write certificate" \ |
| 4675 | -C "skip write certificate verify" \ |
| 4676 | -S "skip parse certificate verify" \ |
| 4677 | -s "x509_verify_cert() returned" \ |
| 4678 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4679 | -S "The certificate has been revoked (is on a CRL)" |
| 4680 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4681 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4682 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4683 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4684 | ca_file=data_files/test-ca.crt \ |
| 4685 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4686 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4687 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4688 | 0 \ |
| 4689 | -S "skip write certificate request" \ |
| 4690 | -C "skip parse certificate request" \ |
| 4691 | -c "got a certificate request" \ |
| 4692 | -C "skip write certificate" \ |
| 4693 | -C "skip write certificate verify" \ |
| 4694 | -S "skip parse certificate verify" \ |
| 4695 | -S "x509_verify_cert() returned" \ |
| 4696 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4697 | -S "The certificate has been revoked (is on a CRL)" |
| 4698 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4699 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4700 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4701 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4702 | ca_file=data_files/test-ca.crt \ |
| 4703 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4704 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4705 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4706 | 1 \ |
| 4707 | -S "skip write certificate request" \ |
| 4708 | -C "skip parse certificate request" \ |
| 4709 | -c "got a certificate request" \ |
| 4710 | -C "skip write certificate" \ |
| 4711 | -C "skip write certificate verify" \ |
| 4712 | -S "skip parse certificate verify" \ |
| 4713 | -s "x509_verify_cert() returned" \ |
| 4714 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4715 | -s "The certificate has been revoked (is on a CRL)" |
| 4716 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4717 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4718 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4719 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4720 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4721 | "$P_CLI nbio=2 tickets=0" \ |
| 4722 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4723 | -S "mbedtls_ssl_handshake returned" \ |
| 4724 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4725 | -c "Read from server: .* bytes read" |
| 4726 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4727 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4728 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4729 | "$P_CLI nbio=2 tickets=0" \ |
| 4730 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4731 | -S "mbedtls_ssl_handshake returned" \ |
| 4732 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4733 | -c "Read from server: .* bytes read" |
| 4734 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4735 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4736 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4737 | "$P_CLI nbio=2 tickets=1" \ |
| 4738 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4739 | -S "mbedtls_ssl_handshake returned" \ |
| 4740 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4741 | -c "Read from server: .* bytes read" |
| 4742 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4743 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4744 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4745 | "$P_CLI nbio=2 tickets=1" \ |
| 4746 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4747 | -S "mbedtls_ssl_handshake returned" \ |
| 4748 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4749 | -c "Read from server: .* bytes read" |
| 4750 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4751 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4752 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4753 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4754 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4755 | -S "mbedtls_ssl_handshake returned" \ |
| 4756 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4757 | -c "Read from server: .* bytes read" |
| 4758 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4759 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4760 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4761 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4762 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4763 | -S "mbedtls_ssl_handshake returned" \ |
| 4764 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4765 | -c "Read from server: .* bytes read" |
| 4766 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4767 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4768 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4769 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4770 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4771 | -S "mbedtls_ssl_handshake returned" \ |
| 4772 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4773 | -c "Read from server: .* bytes read" |
| 4774 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4775 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4776 | |
| 4777 | run_test "Event-driven I/O: basic handshake" \ |
| 4778 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4779 | "$P_CLI event=1 tickets=0" \ |
| 4780 | 0 \ |
| 4781 | -S "mbedtls_ssl_handshake returned" \ |
| 4782 | -C "mbedtls_ssl_handshake returned" \ |
| 4783 | -c "Read from server: .* bytes read" |
| 4784 | |
| 4785 | run_test "Event-driven I/O: client auth" \ |
| 4786 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4787 | "$P_CLI event=1 tickets=0" \ |
| 4788 | 0 \ |
| 4789 | -S "mbedtls_ssl_handshake returned" \ |
| 4790 | -C "mbedtls_ssl_handshake returned" \ |
| 4791 | -c "Read from server: .* bytes read" |
| 4792 | |
| 4793 | run_test "Event-driven I/O: ticket" \ |
| 4794 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4795 | "$P_CLI event=1 tickets=1" \ |
| 4796 | 0 \ |
| 4797 | -S "mbedtls_ssl_handshake returned" \ |
| 4798 | -C "mbedtls_ssl_handshake returned" \ |
| 4799 | -c "Read from server: .* bytes read" |
| 4800 | |
| 4801 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4802 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4803 | "$P_CLI event=1 tickets=1" \ |
| 4804 | 0 \ |
| 4805 | -S "mbedtls_ssl_handshake returned" \ |
| 4806 | -C "mbedtls_ssl_handshake returned" \ |
| 4807 | -c "Read from server: .* bytes read" |
| 4808 | |
| 4809 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4810 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4811 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4812 | 0 \ |
| 4813 | -S "mbedtls_ssl_handshake returned" \ |
| 4814 | -C "mbedtls_ssl_handshake returned" \ |
| 4815 | -c "Read from server: .* bytes read" |
| 4816 | |
| 4817 | run_test "Event-driven I/O: ticket + resume" \ |
| 4818 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4819 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4820 | 0 \ |
| 4821 | -S "mbedtls_ssl_handshake returned" \ |
| 4822 | -C "mbedtls_ssl_handshake returned" \ |
| 4823 | -c "Read from server: .* bytes read" |
| 4824 | |
| 4825 | run_test "Event-driven I/O: session-id resume" \ |
| 4826 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4827 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4828 | 0 \ |
| 4829 | -S "mbedtls_ssl_handshake returned" \ |
| 4830 | -C "mbedtls_ssl_handshake returned" \ |
| 4831 | -c "Read from server: .* bytes read" |
| 4832 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4833 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4834 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4835 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4836 | 0 \ |
| 4837 | -c "Read from server: .* bytes read" |
| 4838 | |
| 4839 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4840 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4841 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4842 | 0 \ |
| 4843 | -c "Read from server: .* bytes read" |
| 4844 | |
| 4845 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4846 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4847 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4848 | 0 \ |
| 4849 | -c "Read from server: .* bytes read" |
| 4850 | |
| 4851 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4852 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4853 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4854 | 0 \ |
| 4855 | -c "Read from server: .* bytes read" |
| 4856 | |
| 4857 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4858 | "$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] | 4859 | "$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] | 4860 | 0 \ |
| 4861 | -c "Read from server: .* bytes read" |
| 4862 | |
| 4863 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4864 | "$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] | 4865 | "$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] | 4866 | 0 \ |
| 4867 | -c "Read from server: .* bytes read" |
| 4868 | |
| 4869 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4870 | "$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] | 4871 | "$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] | 4872 | 0 \ |
| 4873 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4874 | |
| 4875 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4876 | # During session resumption, the client will send its ApplicationData record |
| 4877 | # within the same datagram as the Finished messages. In this situation, the |
| 4878 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4879 | # because the ApplicationData request has already been queued internally. |
| 4880 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4881 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4882 | "$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] | 4883 | "$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] | 4884 | 0 \ |
| 4885 | -c "Read from server: .* bytes read" |
| 4886 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4887 | # Tests for version negotiation |
| 4888 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4889 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4890 | "$P_SRV" \ |
| 4891 | "$P_CLI" \ |
| 4892 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4893 | -S "mbedtls_ssl_handshake returned" \ |
| 4894 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4895 | -s "Protocol is TLSv1.2" \ |
| 4896 | -c "Protocol is TLSv1.2" |
| 4897 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 4898 | run_test "Not supported version check: cli TLS 1.0" \ |
| 4899 | "$P_SRV" \ |
| 4900 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 4901 | 1 \ |
| 4902 | -s "Handshake protocol not within min/max boundaries" \ |
| 4903 | -c "Error in protocol version" \ |
| 4904 | -S "Protocol is TLSv1.0" \ |
| 4905 | -C "Handshake was completed" |
| 4906 | |
| 4907 | run_test "Not supported version check: cli TLS 1.1" \ |
| 4908 | "$P_SRV" \ |
| 4909 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 4910 | 1 \ |
| 4911 | -s "Handshake protocol not within min/max boundaries" \ |
| 4912 | -c "Error in protocol version" \ |
| 4913 | -S "Protocol is TLSv1.1" \ |
| 4914 | -C "Handshake was completed" |
| 4915 | |
| 4916 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 4917 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 4918 | "$P_CLI" \ |
| 4919 | 1 \ |
| 4920 | -s "Error in protocol version" \ |
| 4921 | -c "Handshake protocol not within min/max boundaries" \ |
| 4922 | -S "Version: TLS1.0" \ |
| 4923 | -C "Protocol is TLSv1.0" |
| 4924 | |
| 4925 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 4926 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 4927 | "$P_CLI" \ |
| 4928 | 1 \ |
| 4929 | -s "Error in protocol version" \ |
| 4930 | -c "Handshake protocol not within min/max boundaries" \ |
| 4931 | -S "Version: TLS1.1" \ |
| 4932 | -C "Protocol is TLSv1.1" |
| 4933 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4934 | # Tests for ALPN extension |
| 4935 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4936 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4937 | "$P_SRV debug_level=3" \ |
| 4938 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4939 | 0 \ |
| 4940 | -C "client hello, adding alpn extension" \ |
| 4941 | -S "found alpn extension" \ |
| 4942 | -C "got an alert message, type: \\[2:120]" \ |
| 4943 | -S "server hello, adding alpn extension" \ |
| 4944 | -C "found alpn extension " \ |
| 4945 | -C "Application Layer Protocol is" \ |
| 4946 | -S "Application Layer Protocol is" |
| 4947 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4948 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4949 | "$P_SRV debug_level=3" \ |
| 4950 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4951 | 0 \ |
| 4952 | -c "client hello, adding alpn extension" \ |
| 4953 | -s "found alpn extension" \ |
| 4954 | -C "got an alert message, type: \\[2:120]" \ |
| 4955 | -S "server hello, adding alpn extension" \ |
| 4956 | -C "found alpn extension " \ |
| 4957 | -c "Application Layer Protocol is (none)" \ |
| 4958 | -S "Application Layer Protocol is" |
| 4959 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4960 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4961 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4962 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4963 | 0 \ |
| 4964 | -C "client hello, adding alpn extension" \ |
| 4965 | -S "found alpn extension" \ |
| 4966 | -C "got an alert message, type: \\[2:120]" \ |
| 4967 | -S "server hello, adding alpn extension" \ |
| 4968 | -C "found alpn extension " \ |
| 4969 | -C "Application Layer Protocol is" \ |
| 4970 | -s "Application Layer Protocol is (none)" |
| 4971 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4972 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4973 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4974 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4975 | 0 \ |
| 4976 | -c "client hello, adding alpn extension" \ |
| 4977 | -s "found alpn extension" \ |
| 4978 | -C "got an alert message, type: \\[2:120]" \ |
| 4979 | -s "server hello, adding alpn extension" \ |
| 4980 | -c "found alpn extension" \ |
| 4981 | -c "Application Layer Protocol is abc" \ |
| 4982 | -s "Application Layer Protocol is abc" |
| 4983 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4984 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4985 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4986 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4987 | 0 \ |
| 4988 | -c "client hello, adding alpn extension" \ |
| 4989 | -s "found alpn extension" \ |
| 4990 | -C "got an alert message, type: \\[2:120]" \ |
| 4991 | -s "server hello, adding alpn extension" \ |
| 4992 | -c "found alpn extension" \ |
| 4993 | -c "Application Layer Protocol is abc" \ |
| 4994 | -s "Application Layer Protocol is abc" |
| 4995 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4996 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4997 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4998 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4999 | 0 \ |
| 5000 | -c "client hello, adding alpn extension" \ |
| 5001 | -s "found alpn extension" \ |
| 5002 | -C "got an alert message, type: \\[2:120]" \ |
| 5003 | -s "server hello, adding alpn extension" \ |
| 5004 | -c "found alpn extension" \ |
| 5005 | -c "Application Layer Protocol is 1234" \ |
| 5006 | -s "Application Layer Protocol is 1234" |
| 5007 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5008 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5009 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5010 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5011 | 1 \ |
| 5012 | -c "client hello, adding alpn extension" \ |
| 5013 | -s "found alpn extension" \ |
| 5014 | -c "got an alert message, type: \\[2:120]" \ |
| 5015 | -S "server hello, adding alpn extension" \ |
| 5016 | -C "found alpn extension" \ |
| 5017 | -C "Application Layer Protocol is 1234" \ |
| 5018 | -S "Application Layer Protocol is 1234" |
| 5019 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5020 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5021 | # Tests for keyUsage in leaf certificates, part 1: |
| 5022 | # server-side certificate/suite selection |
| 5023 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5024 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5025 | "$P_SRV key_file=data_files/server2.key \ |
| 5026 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5027 | "$P_CLI" \ |
| 5028 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5029 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5030 | |
| 5031 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5032 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5033 | "$P_SRV key_file=data_files/server2.key \ |
| 5034 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5035 | "$P_CLI" \ |
| 5036 | 0 \ |
| 5037 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5038 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5039 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5040 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5041 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5042 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5043 | 1 \ |
| 5044 | -C "Ciphersuite is " |
| 5045 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5046 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5047 | "$P_SRV key_file=data_files/server5.key \ |
| 5048 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5049 | "$P_CLI" \ |
| 5050 | 0 \ |
| 5051 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5052 | |
| 5053 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5054 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5055 | "$P_SRV key_file=data_files/server5.key \ |
| 5056 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5057 | "$P_CLI" \ |
| 5058 | 0 \ |
| 5059 | -c "Ciphersuite is TLS-ECDH-" |
| 5060 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5061 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5062 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5063 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5064 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5065 | 1 \ |
| 5066 | -C "Ciphersuite is " |
| 5067 | |
| 5068 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5069 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5070 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5071 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5072 | "$O_SRV -key data_files/server2.key \ |
| 5073 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5074 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5075 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5076 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5077 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5078 | -C "Processing of the Certificate handshake message failed" \ |
| 5079 | -c "Ciphersuite is TLS-" |
| 5080 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5081 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5082 | "$O_SRV -key data_files/server2.key \ |
| 5083 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5084 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5085 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5086 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5087 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5088 | -C "Processing of the Certificate handshake message failed" \ |
| 5089 | -c "Ciphersuite is TLS-" |
| 5090 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5091 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5092 | "$O_SRV -key data_files/server2.key \ |
| 5093 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5094 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5095 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5096 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5097 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5098 | -C "Processing of the Certificate handshake message failed" \ |
| 5099 | -c "Ciphersuite is TLS-" |
| 5100 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5101 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5102 | "$O_SRV -key data_files/server2.key \ |
| 5103 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5104 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5105 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5106 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5107 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5108 | -c "Processing of the Certificate handshake message failed" \ |
| 5109 | -C "Ciphersuite is TLS-" |
| 5110 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5111 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5112 | "$O_SRV -key data_files/server2.key \ |
| 5113 | -cert data_files/server2.ku-ke.crt" \ |
| 5114 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5115 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5116 | 0 \ |
| 5117 | -c "bad certificate (usage extensions)" \ |
| 5118 | -C "Processing of the Certificate handshake message failed" \ |
| 5119 | -c "Ciphersuite is TLS-" \ |
| 5120 | -c "! Usage does not match the keyUsage extension" |
| 5121 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5122 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5123 | "$O_SRV -key data_files/server2.key \ |
| 5124 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5125 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5126 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5127 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5128 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5129 | -C "Processing of the Certificate handshake message failed" \ |
| 5130 | -c "Ciphersuite is TLS-" |
| 5131 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5132 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5133 | "$O_SRV -key data_files/server2.key \ |
| 5134 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5135 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5136 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5137 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5138 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5139 | -c "Processing of the Certificate handshake message failed" \ |
| 5140 | -C "Ciphersuite is TLS-" |
| 5141 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5142 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5143 | "$O_SRV -key data_files/server2.key \ |
| 5144 | -cert data_files/server2.ku-ds.crt" \ |
| 5145 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5146 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5147 | 0 \ |
| 5148 | -c "bad certificate (usage extensions)" \ |
| 5149 | -C "Processing of the Certificate handshake message failed" \ |
| 5150 | -c "Ciphersuite is TLS-" \ |
| 5151 | -c "! Usage does not match the keyUsage extension" |
| 5152 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5153 | # Tests for keyUsage in leaf certificates, part 3: |
| 5154 | # server-side checking of client cert |
| 5155 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5156 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5157 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5158 | "$O_CLI -key data_files/server2.key \ |
| 5159 | -cert data_files/server2.ku-ds.crt" \ |
| 5160 | 0 \ |
| 5161 | -S "bad certificate (usage extensions)" \ |
| 5162 | -S "Processing of the Certificate handshake message failed" |
| 5163 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5164 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5165 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5166 | "$O_CLI -key data_files/server2.key \ |
| 5167 | -cert data_files/server2.ku-ke.crt" \ |
| 5168 | 0 \ |
| 5169 | -s "bad certificate (usage extensions)" \ |
| 5170 | -S "Processing of the Certificate handshake message failed" |
| 5171 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5172 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5173 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5174 | "$O_CLI -key data_files/server2.key \ |
| 5175 | -cert data_files/server2.ku-ke.crt" \ |
| 5176 | 1 \ |
| 5177 | -s "bad certificate (usage extensions)" \ |
| 5178 | -s "Processing of the Certificate handshake message failed" |
| 5179 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5180 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5181 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5182 | "$O_CLI -key data_files/server5.key \ |
| 5183 | -cert data_files/server5.ku-ds.crt" \ |
| 5184 | 0 \ |
| 5185 | -S "bad certificate (usage extensions)" \ |
| 5186 | -S "Processing of the Certificate handshake message failed" |
| 5187 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5188 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5189 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5190 | "$O_CLI -key data_files/server5.key \ |
| 5191 | -cert data_files/server5.ku-ka.crt" \ |
| 5192 | 0 \ |
| 5193 | -s "bad certificate (usage extensions)" \ |
| 5194 | -S "Processing of the Certificate handshake message failed" |
| 5195 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5196 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5197 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5198 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5199 | "$P_SRV key_file=data_files/server5.key \ |
| 5200 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5201 | "$P_CLI" \ |
| 5202 | 0 |
| 5203 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5204 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5205 | "$P_SRV key_file=data_files/server5.key \ |
| 5206 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5207 | "$P_CLI" \ |
| 5208 | 0 |
| 5209 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5210 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5211 | "$P_SRV key_file=data_files/server5.key \ |
| 5212 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5213 | "$P_CLI" \ |
| 5214 | 0 |
| 5215 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5216 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5217 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5218 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5219 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5220 | 1 |
| 5221 | |
| 5222 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5223 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5224 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5225 | "$O_SRV -key data_files/server5.key \ |
| 5226 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5227 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5228 | 0 \ |
| 5229 | -C "bad certificate (usage extensions)" \ |
| 5230 | -C "Processing of the Certificate handshake message failed" \ |
| 5231 | -c "Ciphersuite is TLS-" |
| 5232 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5233 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5234 | "$O_SRV -key data_files/server5.key \ |
| 5235 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5236 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5237 | 0 \ |
| 5238 | -C "bad certificate (usage extensions)" \ |
| 5239 | -C "Processing of the Certificate handshake message failed" \ |
| 5240 | -c "Ciphersuite is TLS-" |
| 5241 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5242 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5243 | "$O_SRV -key data_files/server5.key \ |
| 5244 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5245 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5246 | 0 \ |
| 5247 | -C "bad certificate (usage extensions)" \ |
| 5248 | -C "Processing of the Certificate handshake message failed" \ |
| 5249 | -c "Ciphersuite is TLS-" |
| 5250 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5251 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5252 | "$O_SRV -key data_files/server5.key \ |
| 5253 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5254 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5255 | 1 \ |
| 5256 | -c "bad certificate (usage extensions)" \ |
| 5257 | -c "Processing of the Certificate handshake message failed" \ |
| 5258 | -C "Ciphersuite is TLS-" |
| 5259 | |
| 5260 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5261 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5262 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5263 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5264 | "$O_CLI -key data_files/server5.key \ |
| 5265 | -cert data_files/server5.eku-cli.crt" \ |
| 5266 | 0 \ |
| 5267 | -S "bad certificate (usage extensions)" \ |
| 5268 | -S "Processing of the Certificate handshake message failed" |
| 5269 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5270 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5271 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5272 | "$O_CLI -key data_files/server5.key \ |
| 5273 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5274 | 0 \ |
| 5275 | -S "bad certificate (usage extensions)" \ |
| 5276 | -S "Processing of the Certificate handshake message failed" |
| 5277 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5278 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5279 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5280 | "$O_CLI -key data_files/server5.key \ |
| 5281 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5282 | 0 \ |
| 5283 | -S "bad certificate (usage extensions)" \ |
| 5284 | -S "Processing of the Certificate handshake message failed" |
| 5285 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5286 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5287 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5288 | "$O_CLI -key data_files/server5.key \ |
| 5289 | -cert data_files/server5.eku-cs.crt" \ |
| 5290 | 0 \ |
| 5291 | -s "bad certificate (usage extensions)" \ |
| 5292 | -S "Processing of the Certificate handshake message failed" |
| 5293 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5294 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5295 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5296 | "$O_CLI -key data_files/server5.key \ |
| 5297 | -cert data_files/server5.eku-cs.crt" \ |
| 5298 | 1 \ |
| 5299 | -s "bad certificate (usage extensions)" \ |
| 5300 | -s "Processing of the Certificate handshake message failed" |
| 5301 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5302 | # Tests for DHM parameters loading |
| 5303 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5304 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5305 | "$P_SRV" \ |
| 5306 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5307 | debug_level=3" \ |
| 5308 | 0 \ |
| 5309 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5310 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5311 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5312 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5313 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5314 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5315 | debug_level=3" \ |
| 5316 | 0 \ |
| 5317 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5318 | -c "value of 'DHM: G ' (2 bits)" |
| 5319 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5320 | # Tests for DHM client-side size checking |
| 5321 | |
| 5322 | run_test "DHM size: server default, client default, OK" \ |
| 5323 | "$P_SRV" \ |
| 5324 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5325 | debug_level=1" \ |
| 5326 | 0 \ |
| 5327 | -C "DHM prime too short:" |
| 5328 | |
| 5329 | run_test "DHM size: server default, client 2048, OK" \ |
| 5330 | "$P_SRV" \ |
| 5331 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5332 | debug_level=1 dhmlen=2048" \ |
| 5333 | 0 \ |
| 5334 | -C "DHM prime too short:" |
| 5335 | |
| 5336 | run_test "DHM size: server 1024, client default, OK" \ |
| 5337 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5338 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5339 | debug_level=1" \ |
| 5340 | 0 \ |
| 5341 | -C "DHM prime too short:" |
| 5342 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5343 | run_test "DHM size: server 999, client 999, OK" \ |
| 5344 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5345 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5346 | debug_level=1 dhmlen=999" \ |
| 5347 | 0 \ |
| 5348 | -C "DHM prime too short:" |
| 5349 | |
| 5350 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5351 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5352 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5353 | debug_level=1 dhmlen=1000" \ |
| 5354 | 0 \ |
| 5355 | -C "DHM prime too short:" |
| 5356 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5357 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5358 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5359 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5360 | debug_level=1" \ |
| 5361 | 1 \ |
| 5362 | -c "DHM prime too short:" |
| 5363 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5364 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5365 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5366 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5367 | debug_level=1 dhmlen=1001" \ |
| 5368 | 1 \ |
| 5369 | -c "DHM prime too short:" |
| 5370 | |
| 5371 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5372 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5373 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5374 | debug_level=1 dhmlen=1000" \ |
| 5375 | 1 \ |
| 5376 | -c "DHM prime too short:" |
| 5377 | |
| 5378 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5379 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5380 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5381 | debug_level=1 dhmlen=999" \ |
| 5382 | 1 \ |
| 5383 | -c "DHM prime too short:" |
| 5384 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5385 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5386 | "$P_SRV" \ |
| 5387 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5388 | debug_level=1 dhmlen=2049" \ |
| 5389 | 1 \ |
| 5390 | -c "DHM prime too short:" |
| 5391 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5392 | # Tests for PSK callback |
| 5393 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5394 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5395 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5396 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5397 | psk_identity=foo psk=abc123" \ |
| 5398 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5399 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5400 | -S "SSL - Unknown identity received" \ |
| 5401 | -S "SSL - Verification of the message MAC failed" |
| 5402 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5403 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5404 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5405 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5406 | "$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] | 5407 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5408 | 0 \ |
| 5409 | -c "skip PMS generation for opaque PSK"\ |
| 5410 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5411 | -C "session hash for extended master secret"\ |
| 5412 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5413 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5414 | -S "SSL - Unknown identity received" \ |
| 5415 | -S "SSL - Verification of the message MAC failed" |
| 5416 | |
| 5417 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5418 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5419 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5420 | "$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] | 5421 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5422 | 0 \ |
| 5423 | -c "skip PMS generation for opaque PSK"\ |
| 5424 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5425 | -C "session hash for extended master secret"\ |
| 5426 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5427 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5428 | -S "SSL - Unknown identity received" \ |
| 5429 | -S "SSL - Verification of the message MAC failed" |
| 5430 | |
| 5431 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5432 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5433 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5434 | "$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] | 5435 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5436 | 0 \ |
| 5437 | -c "skip PMS generation for opaque PSK"\ |
| 5438 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5439 | -c "session hash for extended master secret"\ |
| 5440 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5441 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5442 | -S "SSL - Unknown identity received" \ |
| 5443 | -S "SSL - Verification of the message MAC failed" |
| 5444 | |
| 5445 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5446 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5447 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5448 | "$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] | 5449 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5450 | 0 \ |
| 5451 | -c "skip PMS generation for opaque PSK"\ |
| 5452 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5453 | -c "session hash for extended master secret"\ |
| 5454 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5455 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5456 | -S "SSL - Unknown identity received" \ |
| 5457 | -S "SSL - Verification of the message MAC failed" |
| 5458 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5459 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5460 | 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] | 5461 | "$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] | 5462 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5463 | psk_identity=foo psk=abc123" \ |
| 5464 | 0 \ |
| 5465 | -C "skip PMS generation for opaque PSK"\ |
| 5466 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5467 | -C "session hash for extended master secret"\ |
| 5468 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5469 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5470 | -S "SSL - Unknown identity received" \ |
| 5471 | -S "SSL - Verification of the message MAC failed" |
| 5472 | |
| 5473 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5474 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5475 | "$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] | 5476 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5477 | psk_identity=foo psk=abc123" \ |
| 5478 | 0 \ |
| 5479 | -C "skip PMS generation for opaque PSK"\ |
| 5480 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5481 | -C "session hash for extended master secret"\ |
| 5482 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5483 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5484 | -S "SSL - Unknown identity received" \ |
| 5485 | -S "SSL - Verification of the message MAC failed" |
| 5486 | |
| 5487 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5488 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5489 | "$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] | 5490 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5491 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5492 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5493 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5494 | -c "session hash for extended master secret"\ |
| 5495 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5496 | -C "skip PMS generation for opaque PSK"\ |
| 5497 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5498 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5499 | -S "SSL - Unknown identity received" \ |
| 5500 | -S "SSL - Verification of the message MAC failed" |
| 5501 | |
| 5502 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5503 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5504 | "$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] | 5505 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5506 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5507 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5508 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5509 | -c "session hash for extended master secret"\ |
| 5510 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5511 | -C "skip PMS generation for opaque PSK"\ |
| 5512 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5513 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5514 | -S "SSL - Unknown identity received" \ |
| 5515 | -S "SSL - Verification of the message MAC failed" |
| 5516 | |
| 5517 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5518 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5519 | "$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] | 5520 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5521 | psk_identity=def psk=beef" \ |
| 5522 | 0 \ |
| 5523 | -C "skip PMS generation for opaque PSK"\ |
| 5524 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5525 | -C "session hash for extended master secret"\ |
| 5526 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5527 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5528 | -S "SSL - Unknown identity received" \ |
| 5529 | -S "SSL - Verification of the message MAC failed" |
| 5530 | |
| 5531 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5532 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5533 | "$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] | 5534 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5535 | psk_identity=def psk=beef" \ |
| 5536 | 0 \ |
| 5537 | -C "skip PMS generation for opaque PSK"\ |
| 5538 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5539 | -C "session hash for extended master secret"\ |
| 5540 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5541 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5542 | -S "SSL - Unknown identity received" \ |
| 5543 | -S "SSL - Verification of the message MAC failed" |
| 5544 | |
| 5545 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5546 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5547 | "$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] | 5548 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5549 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5550 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5551 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5552 | -c "session hash for extended master secret"\ |
| 5553 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5554 | -C "skip PMS generation for opaque PSK"\ |
| 5555 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5556 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5557 | -S "SSL - Unknown identity received" \ |
| 5558 | -S "SSL - Verification of the message MAC failed" |
| 5559 | |
| 5560 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5561 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5562 | "$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] | 5563 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5564 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5565 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5566 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5567 | -c "session hash for extended master secret"\ |
| 5568 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5569 | -C "skip PMS generation for opaque PSK"\ |
| 5570 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5571 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5572 | -S "SSL - Unknown identity received" \ |
| 5573 | -S "SSL - Verification of the message MAC failed" |
| 5574 | |
| 5575 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5576 | 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] | 5577 | "$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] | 5578 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5579 | psk_identity=def psk=beef" \ |
| 5580 | 0 \ |
| 5581 | -C "skip PMS generation for opaque PSK"\ |
| 5582 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5583 | -C "session hash for extended master secret"\ |
| 5584 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5585 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5586 | -S "SSL - Unknown identity received" \ |
| 5587 | -S "SSL - Verification of the message MAC failed" |
| 5588 | |
| 5589 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5590 | 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] | 5591 | "$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] | 5592 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5593 | psk_identity=def psk=beef" \ |
| 5594 | 0 \ |
| 5595 | -C "skip PMS generation for opaque PSK"\ |
| 5596 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5597 | -C "session hash for extended master secret"\ |
| 5598 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5599 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5600 | -S "SSL - Unknown identity received" \ |
| 5601 | -S "SSL - Verification of the message MAC failed" |
| 5602 | |
| 5603 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5604 | 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] | 5605 | "$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] | 5606 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5607 | psk_identity=def psk=beef" \ |
| 5608 | 0 \ |
| 5609 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5610 | -C "session hash for extended master secret"\ |
| 5611 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5612 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5613 | -S "SSL - Unknown identity received" \ |
| 5614 | -S "SSL - Verification of the message MAC failed" |
| 5615 | |
| 5616 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5617 | 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] | 5618 | "$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] | 5619 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5620 | psk_identity=def psk=beef" \ |
| 5621 | 0 \ |
| 5622 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5623 | -C "session hash for extended master secret"\ |
| 5624 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5625 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5626 | -S "SSL - Unknown identity received" \ |
| 5627 | -S "SSL - Verification of the message MAC failed" |
| 5628 | |
| 5629 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5630 | 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] | 5631 | "$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] | 5632 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5633 | psk_identity=def psk=beef" \ |
| 5634 | 1 \ |
| 5635 | -s "SSL - Verification of the message MAC failed" |
| 5636 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5637 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5638 | "$P_SRV" \ |
| 5639 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5640 | psk_identity=foo psk=abc123" \ |
| 5641 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5642 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5643 | -S "SSL - Unknown identity received" \ |
| 5644 | -S "SSL - Verification of the message MAC failed" |
| 5645 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5646 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5647 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5648 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5649 | psk_identity=foo psk=abc123" \ |
| 5650 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5651 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5652 | -s "SSL - Unknown identity received" \ |
| 5653 | -S "SSL - Verification of the message MAC failed" |
| 5654 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5655 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5656 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5657 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5658 | psk_identity=abc psk=dead" \ |
| 5659 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5660 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5661 | -S "SSL - Unknown identity received" \ |
| 5662 | -S "SSL - Verification of the message MAC failed" |
| 5663 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5664 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5665 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5666 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5667 | psk_identity=def psk=beef" \ |
| 5668 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5669 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5670 | -S "SSL - Unknown identity received" \ |
| 5671 | -S "SSL - Verification of the message MAC failed" |
| 5672 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5673 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5674 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5675 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5676 | psk_identity=ghi psk=beef" \ |
| 5677 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5678 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5679 | -s "SSL - Unknown identity received" \ |
| 5680 | -S "SSL - Verification of the message MAC failed" |
| 5681 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5682 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5683 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5684 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5685 | psk_identity=abc psk=beef" \ |
| 5686 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5687 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5688 | -S "SSL - Unknown identity received" \ |
| 5689 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5690 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5691 | # Tests for EC J-PAKE |
| 5692 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5693 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5694 | run_test "ECJPAKE: client not configured" \ |
| 5695 | "$P_SRV debug_level=3" \ |
| 5696 | "$P_CLI debug_level=3" \ |
| 5697 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5698 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5699 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5700 | -S "found ecjpake kkpp extension" \ |
| 5701 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5702 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5703 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5704 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5705 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5706 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5707 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5708 | run_test "ECJPAKE: server not configured" \ |
| 5709 | "$P_SRV debug_level=3" \ |
| 5710 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5711 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5712 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5713 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5714 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5715 | -s "found ecjpake kkpp extension" \ |
| 5716 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5717 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5718 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5719 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5720 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5721 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5722 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5723 | run_test "ECJPAKE: working, TLS" \ |
| 5724 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5725 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5726 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5727 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5728 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5729 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5730 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5731 | -s "found ecjpake kkpp extension" \ |
| 5732 | -S "skip ecjpake kkpp extension" \ |
| 5733 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5734 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5735 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5736 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5737 | -S "SSL - Verification of the message MAC failed" |
| 5738 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5739 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5740 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5741 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5742 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5743 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5744 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5745 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5746 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5747 | -s "SSL - Verification of the message MAC failed" |
| 5748 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5749 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5750 | run_test "ECJPAKE: working, DTLS" \ |
| 5751 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5752 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5753 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5754 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5755 | -c "re-using cached ecjpake parameters" \ |
| 5756 | -S "SSL - Verification of the message MAC failed" |
| 5757 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5758 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5759 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5760 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5761 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5762 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5763 | 0 \ |
| 5764 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5765 | -S "SSL - Verification of the message MAC failed" |
| 5766 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5767 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5768 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5769 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5770 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5771 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5772 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5773 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5774 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5775 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5776 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5777 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5778 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5779 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5780 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5781 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5782 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5783 | 0 |
| 5784 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5785 | # Test for ClientHello without extensions |
| 5786 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5787 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5788 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5789 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5790 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5791 | 0 \ |
| 5792 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5793 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5794 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5795 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5796 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5797 | "$P_SRV" \ |
| 5798 | "$P_CLI request_size=100" \ |
| 5799 | 0 \ |
| 5800 | -s "Read from client: 100 bytes read$" |
| 5801 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5802 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5803 | "$P_SRV" \ |
| 5804 | "$P_CLI request_size=500" \ |
| 5805 | 0 \ |
| 5806 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5807 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5808 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5809 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5810 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5811 | "$P_SRV" \ |
| 5812 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5813 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5814 | 0 \ |
| 5815 | -s "Read from client: 1 bytes read" |
| 5816 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5817 | 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] | 5818 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5819 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5820 | 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] | 5821 | 0 \ |
| 5822 | -s "Read from client: 1 bytes read" |
| 5823 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5824 | 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] | 5825 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5826 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5827 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5828 | 0 \ |
| 5829 | -s "Read from client: 1 bytes read" |
| 5830 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5831 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5832 | "$P_SRV" \ |
| 5833 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5834 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5835 | 0 \ |
| 5836 | -s "Read from client: 1 bytes read" |
| 5837 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5838 | 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] | 5839 | "$P_SRV" \ |
| 5840 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5841 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5842 | 0 \ |
| 5843 | -s "Read from client: 1 bytes read" |
| 5844 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5845 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5846 | |
| 5847 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5848 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5849 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5850 | "$P_CLI dtls=1 request_size=1 \ |
| 5851 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5852 | 0 \ |
| 5853 | -s "Read from client: 1 bytes read" |
| 5854 | |
| 5855 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5856 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5857 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5858 | "$P_CLI dtls=1 request_size=1 \ |
| 5859 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5860 | 0 \ |
| 5861 | -s "Read from client: 1 bytes read" |
| 5862 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5863 | # Tests for small server packets |
| 5864 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5865 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5866 | "$P_SRV response_size=1" \ |
| 5867 | "$P_CLI force_version=tls1_2 \ |
| 5868 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5869 | 0 \ |
| 5870 | -c "Read from server: 1 bytes read" |
| 5871 | |
| 5872 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5873 | "$P_SRV response_size=1" \ |
| 5874 | "$P_CLI force_version=tls1_2 \ |
| 5875 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5876 | 0 \ |
| 5877 | -c "Read from server: 1 bytes read" |
| 5878 | |
| 5879 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5880 | "$P_SRV response_size=1" \ |
| 5881 | "$P_CLI force_version=tls1_2 \ |
| 5882 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5883 | 0 \ |
| 5884 | -c "Read from server: 1 bytes read" |
| 5885 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5886 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5887 | "$P_SRV response_size=1" \ |
| 5888 | "$P_CLI force_version=tls1_2 \ |
| 5889 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5890 | 0 \ |
| 5891 | -c "Read from server: 1 bytes read" |
| 5892 | |
| 5893 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5894 | "$P_SRV response_size=1" \ |
| 5895 | "$P_CLI force_version=tls1_2 \ |
| 5896 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5897 | 0 \ |
| 5898 | -c "Read from server: 1 bytes read" |
| 5899 | |
| 5900 | # Tests for small server packets in DTLS |
| 5901 | |
| 5902 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5903 | run_test "Small server packet DTLS 1.2" \ |
| 5904 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5905 | "$P_CLI dtls=1 \ |
| 5906 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5907 | 0 \ |
| 5908 | -c "Read from server: 1 bytes read" |
| 5909 | |
| 5910 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5911 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5912 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5913 | "$P_CLI dtls=1 \ |
| 5914 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5915 | 0 \ |
| 5916 | -c "Read from server: 1 bytes read" |
| 5917 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5918 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5919 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5920 | # How many fragments do we expect to write $1 bytes? |
| 5921 | fragments_for_write() { |
| 5922 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5923 | } |
| 5924 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5925 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5926 | "$P_SRV" \ |
| 5927 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5928 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5929 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5930 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5931 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5932 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5933 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5934 | "$P_SRV" \ |
| 5935 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5936 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5937 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5938 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5939 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5940 | 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] | 5941 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5942 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5943 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5944 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5945 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5946 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5947 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5948 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5949 | "$P_SRV" \ |
| 5950 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5951 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5952 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5953 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5954 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5955 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5956 | 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] | 5957 | "$P_SRV" \ |
| 5958 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5959 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5960 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5961 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5962 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5963 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 5964 | # 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] | 5965 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5966 | "$P_SRV response_size=16384" \ |
| 5967 | "$P_CLI force_version=tls1_2 \ |
| 5968 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5969 | 0 \ |
| 5970 | -c "Read from server: 16384 bytes read" |
| 5971 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5972 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5973 | "$P_SRV response_size=16384" \ |
| 5974 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5975 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5976 | 0 \ |
| 5977 | -s "16384 bytes written in 1 fragments" \ |
| 5978 | -c "Read from server: 16384 bytes read" |
| 5979 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5980 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5981 | "$P_SRV response_size=16384" \ |
| 5982 | "$P_CLI force_version=tls1_2 \ |
| 5983 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5984 | 0 \ |
| 5985 | -c "Read from server: 16384 bytes read" |
| 5986 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5987 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5988 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5989 | "$P_CLI force_version=tls1_2 \ |
| 5990 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5991 | 0 \ |
| 5992 | -s "16384 bytes written in 1 fragments" \ |
| 5993 | -c "Read from server: 16384 bytes read" |
| 5994 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5995 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5996 | "$P_SRV response_size=16384" \ |
| 5997 | "$P_CLI force_version=tls1_2 \ |
| 5998 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5999 | 0 \ |
| 6000 | -c "Read from server: 16384 bytes read" |
| 6001 | |
| 6002 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6003 | "$P_SRV response_size=16384" \ |
| 6004 | "$P_CLI force_version=tls1_2 \ |
| 6005 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6006 | 0 \ |
| 6007 | -c "Read from server: 16384 bytes read" |
| 6008 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6009 | # Tests for restartable ECC |
| 6010 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6011 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 6012 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6013 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6014 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6015 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6016 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6017 | "$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] | 6018 | 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] | 6019 | debug_level=1" \ |
| 6020 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6021 | -C "x509_verify_cert.*4b00" \ |
| 6022 | -C "mbedtls_pk_verify.*4b00" \ |
| 6023 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6024 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6025 | |
| 6026 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6027 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6028 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6029 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6030 | "$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] | 6031 | 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] | 6032 | debug_level=1 ec_max_ops=0" \ |
| 6033 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6034 | -C "x509_verify_cert.*4b00" \ |
| 6035 | -C "mbedtls_pk_verify.*4b00" \ |
| 6036 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6037 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6038 | |
| 6039 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6040 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6041 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6042 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6043 | "$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] | 6044 | 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] | 6045 | debug_level=1 ec_max_ops=65535" \ |
| 6046 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6047 | -C "x509_verify_cert.*4b00" \ |
| 6048 | -C "mbedtls_pk_verify.*4b00" \ |
| 6049 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6050 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6051 | |
| 6052 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6053 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6054 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6055 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6056 | "$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] | 6057 | 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] | 6058 | debug_level=1 ec_max_ops=1000" \ |
| 6059 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6060 | -c "x509_verify_cert.*4b00" \ |
| 6061 | -c "mbedtls_pk_verify.*4b00" \ |
| 6062 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6063 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6064 | |
| 6065 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6066 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6067 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6068 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6069 | crt_file=data_files/server5-badsign.crt \ |
| 6070 | key_file=data_files/server5.key" \ |
| 6071 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6072 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6073 | debug_level=1 ec_max_ops=1000" \ |
| 6074 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6075 | -c "x509_verify_cert.*4b00" \ |
| 6076 | -C "mbedtls_pk_verify.*4b00" \ |
| 6077 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6078 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6079 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6080 | -c "! mbedtls_ssl_handshake returned" \ |
| 6081 | -c "X509 - Certificate verification failed" |
| 6082 | |
| 6083 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6084 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6085 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6086 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6087 | crt_file=data_files/server5-badsign.crt \ |
| 6088 | key_file=data_files/server5.key" \ |
| 6089 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6090 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6091 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6092 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6093 | -c "x509_verify_cert.*4b00" \ |
| 6094 | -c "mbedtls_pk_verify.*4b00" \ |
| 6095 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6096 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6097 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6098 | -C "! mbedtls_ssl_handshake returned" \ |
| 6099 | -C "X509 - Certificate verification failed" |
| 6100 | |
| 6101 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6102 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6103 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6104 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6105 | crt_file=data_files/server5-badsign.crt \ |
| 6106 | key_file=data_files/server5.key" \ |
| 6107 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6108 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6109 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6110 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6111 | -C "x509_verify_cert.*4b00" \ |
| 6112 | -c "mbedtls_pk_verify.*4b00" \ |
| 6113 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6114 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6115 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6116 | -C "! mbedtls_ssl_handshake returned" \ |
| 6117 | -C "X509 - Certificate verification failed" |
| 6118 | |
| 6119 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6120 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6121 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6122 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6123 | "$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] | 6124 | 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] | 6125 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6126 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6127 | -c "x509_verify_cert.*4b00" \ |
| 6128 | -c "mbedtls_pk_verify.*4b00" \ |
| 6129 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6130 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6131 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6132 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6133 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6134 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6135 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6136 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6137 | debug_level=1 ec_max_ops=1000" \ |
| 6138 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6139 | -c "x509_verify_cert.*4b00" \ |
| 6140 | -c "mbedtls_pk_verify.*4b00" \ |
| 6141 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6142 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6143 | |
| 6144 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6145 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6146 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6147 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6148 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6149 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6150 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6151 | -C "x509_verify_cert.*4b00" \ |
| 6152 | -C "mbedtls_pk_verify.*4b00" \ |
| 6153 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6154 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6155 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6156 | # Tests of asynchronous private key support in SSL |
| 6157 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6158 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6159 | run_test "SSL async private: sign, delay=0" \ |
| 6160 | "$P_SRV \ |
| 6161 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6162 | "$P_CLI" \ |
| 6163 | 0 \ |
| 6164 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6165 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6166 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6167 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6168 | run_test "SSL async private: sign, delay=1" \ |
| 6169 | "$P_SRV \ |
| 6170 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6171 | "$P_CLI" \ |
| 6172 | 0 \ |
| 6173 | -s "Async sign callback: using key slot " \ |
| 6174 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6175 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6176 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6177 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6178 | run_test "SSL async private: sign, delay=2" \ |
| 6179 | "$P_SRV \ |
| 6180 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6181 | "$P_CLI" \ |
| 6182 | 0 \ |
| 6183 | -s "Async sign callback: using key slot " \ |
| 6184 | -U "Async sign callback: using key slot " \ |
| 6185 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6186 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6187 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6188 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6189 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6190 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6191 | run_test "SSL async private: sign, SNI" \ |
| 6192 | "$P_SRV debug_level=3 \ |
| 6193 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6194 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6195 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6196 | "$P_CLI server_name=polarssl.example" \ |
| 6197 | 0 \ |
| 6198 | -s "Async sign callback: using key slot " \ |
| 6199 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6200 | -s "parse ServerName extension" \ |
| 6201 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6202 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6203 | |
| 6204 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6205 | run_test "SSL async private: decrypt, delay=0" \ |
| 6206 | "$P_SRV \ |
| 6207 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6208 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6209 | 0 \ |
| 6210 | -s "Async decrypt callback: using key slot " \ |
| 6211 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6212 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6213 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6214 | run_test "SSL async private: decrypt, delay=1" \ |
| 6215 | "$P_SRV \ |
| 6216 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6217 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6218 | 0 \ |
| 6219 | -s "Async decrypt callback: using key slot " \ |
| 6220 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6221 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6222 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6223 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6224 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6225 | "$P_SRV psk=abc123 \ |
| 6226 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6227 | "$P_CLI psk=abc123 \ |
| 6228 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6229 | 0 \ |
| 6230 | -s "Async decrypt callback: using key slot " \ |
| 6231 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6232 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6233 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6234 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6235 | "$P_SRV psk=abc123 \ |
| 6236 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6237 | "$P_CLI psk=abc123 \ |
| 6238 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6239 | 0 \ |
| 6240 | -s "Async decrypt callback: using key slot " \ |
| 6241 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6242 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6243 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6244 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6245 | run_test "SSL async private: sign callback not present" \ |
| 6246 | "$P_SRV \ |
| 6247 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6248 | "$P_CLI; [ \$? -eq 1 ] && |
| 6249 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6250 | 0 \ |
| 6251 | -S "Async sign callback" \ |
| 6252 | -s "! mbedtls_ssl_handshake returned" \ |
| 6253 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6254 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6255 | -s "Successful connection" |
| 6256 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6257 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6258 | run_test "SSL async private: decrypt callback not present" \ |
| 6259 | "$P_SRV debug_level=1 \ |
| 6260 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6261 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6262 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6263 | 0 \ |
| 6264 | -S "Async decrypt callback" \ |
| 6265 | -s "! mbedtls_ssl_handshake returned" \ |
| 6266 | -s "got no RSA private key" \ |
| 6267 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6268 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6269 | |
| 6270 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6271 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6272 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6273 | "$P_SRV \ |
| 6274 | async_operations=s async_private_delay1=1 \ |
| 6275 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6276 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6277 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6278 | 0 \ |
| 6279 | -s "Async sign callback: using key slot 0," \ |
| 6280 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6281 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6282 | |
| 6283 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6284 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6285 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6286 | "$P_SRV \ |
| 6287 | async_operations=s async_private_delay2=1 \ |
| 6288 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6289 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6290 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6291 | 0 \ |
| 6292 | -s "Async sign callback: using key slot 0," \ |
| 6293 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6294 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6295 | |
| 6296 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6297 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6298 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6299 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6300 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6301 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6302 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6303 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6304 | 0 \ |
| 6305 | -s "Async sign callback: using key slot 1," \ |
| 6306 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6307 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6308 | |
| 6309 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6310 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6311 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6312 | "$P_SRV \ |
| 6313 | async_operations=s async_private_delay1=1 \ |
| 6314 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6315 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6316 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6317 | 0 \ |
| 6318 | -s "Async sign callback: no key matches this certificate." |
| 6319 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6320 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6321 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6322 | "$P_SRV \ |
| 6323 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6324 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6325 | "$P_CLI" \ |
| 6326 | 1 \ |
| 6327 | -s "Async sign callback: injected error" \ |
| 6328 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6329 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6330 | -s "! mbedtls_ssl_handshake returned" |
| 6331 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6332 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6333 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6334 | "$P_SRV \ |
| 6335 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6336 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6337 | "$P_CLI" \ |
| 6338 | 1 \ |
| 6339 | -s "Async sign callback: using key slot " \ |
| 6340 | -S "Async resume" \ |
| 6341 | -s "Async cancel" |
| 6342 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6343 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6344 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6345 | "$P_SRV \ |
| 6346 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6347 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6348 | "$P_CLI" \ |
| 6349 | 1 \ |
| 6350 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6351 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6352 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6353 | -s "! mbedtls_ssl_handshake returned" |
| 6354 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6355 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6356 | run_test "SSL async private: decrypt, error in start" \ |
| 6357 | "$P_SRV \ |
| 6358 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6359 | async_private_error=1" \ |
| 6360 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6361 | 1 \ |
| 6362 | -s "Async decrypt callback: injected error" \ |
| 6363 | -S "Async resume" \ |
| 6364 | -S "Async cancel" \ |
| 6365 | -s "! mbedtls_ssl_handshake returned" |
| 6366 | |
| 6367 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6368 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6369 | "$P_SRV \ |
| 6370 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6371 | async_private_error=2" \ |
| 6372 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6373 | 1 \ |
| 6374 | -s "Async decrypt callback: using key slot " \ |
| 6375 | -S "Async resume" \ |
| 6376 | -s "Async cancel" |
| 6377 | |
| 6378 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6379 | run_test "SSL async private: decrypt, error in resume" \ |
| 6380 | "$P_SRV \ |
| 6381 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6382 | async_private_error=3" \ |
| 6383 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6384 | 1 \ |
| 6385 | -s "Async decrypt callback: using key slot " \ |
| 6386 | -s "Async resume callback: decrypt done but injected error" \ |
| 6387 | -S "Async cancel" \ |
| 6388 | -s "! mbedtls_ssl_handshake returned" |
| 6389 | |
| 6390 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6391 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6392 | "$P_SRV \ |
| 6393 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6394 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6395 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6396 | 0 \ |
| 6397 | -s "Async cancel" \ |
| 6398 | -s "! mbedtls_ssl_handshake returned" \ |
| 6399 | -s "Async resume" \ |
| 6400 | -s "Successful connection" |
| 6401 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6402 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6403 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6404 | "$P_SRV \ |
| 6405 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6406 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6407 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6408 | 0 \ |
| 6409 | -s "! mbedtls_ssl_handshake returned" \ |
| 6410 | -s "Async resume" \ |
| 6411 | -s "Successful connection" |
| 6412 | |
| 6413 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6414 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6415 | 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] | 6416 | "$P_SRV \ |
| 6417 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6418 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6419 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6420 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6421 | [ \$? -eq 1 ] && |
| 6422 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6423 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6424 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6425 | -S "Async resume" \ |
| 6426 | -s "Async cancel" \ |
| 6427 | -s "! mbedtls_ssl_handshake returned" \ |
| 6428 | -s "Async sign callback: no key matches this certificate." \ |
| 6429 | -s "Successful connection" |
| 6430 | |
| 6431 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6432 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6433 | 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] | 6434 | "$P_SRV \ |
| 6435 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6436 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6437 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6438 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6439 | [ \$? -eq 1 ] && |
| 6440 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6441 | 0 \ |
| 6442 | -s "Async resume" \ |
| 6443 | -s "! mbedtls_ssl_handshake returned" \ |
| 6444 | -s "Async sign callback: no key matches this certificate." \ |
| 6445 | -s "Successful connection" |
| 6446 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6447 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6448 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6449 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6450 | "$P_SRV \ |
| 6451 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6452 | exchanges=2 renegotiation=1" \ |
| 6453 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6454 | 0 \ |
| 6455 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6456 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6457 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6458 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6459 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6460 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6461 | "$P_SRV \ |
| 6462 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6463 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6464 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6465 | 0 \ |
| 6466 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6467 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6468 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6469 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6470 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6471 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6472 | "$P_SRV \ |
| 6473 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6474 | exchanges=2 renegotiation=1" \ |
| 6475 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6476 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6477 | 0 \ |
| 6478 | -s "Async decrypt callback: using key slot " \ |
| 6479 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6480 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6481 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6482 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6483 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6484 | "$P_SRV \ |
| 6485 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6486 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6487 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6488 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6489 | 0 \ |
| 6490 | -s "Async decrypt callback: using key slot " \ |
| 6491 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6492 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6493 | # Tests for ECC extensions (rfc 4492) |
| 6494 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6495 | requires_config_enabled MBEDTLS_AES_C |
| 6496 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6497 | requires_config_enabled MBEDTLS_SHA256_C |
| 6498 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6499 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6500 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6501 | "$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] | 6502 | 0 \ |
| 6503 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6504 | -C "client hello, adding supported_point_formats extension" \ |
| 6505 | -S "found supported elliptic curves extension" \ |
| 6506 | -S "found supported point formats extension" |
| 6507 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6508 | requires_config_enabled MBEDTLS_AES_C |
| 6509 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6510 | requires_config_enabled MBEDTLS_SHA256_C |
| 6511 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6512 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6513 | "$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] | 6514 | "$P_CLI debug_level=3" \ |
| 6515 | 0 \ |
| 6516 | -C "found supported_point_formats extension" \ |
| 6517 | -S "server hello, supported_point_formats extension" |
| 6518 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6519 | requires_config_enabled MBEDTLS_AES_C |
| 6520 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6521 | requires_config_enabled MBEDTLS_SHA256_C |
| 6522 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6523 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6524 | "$P_SRV debug_level=3" \ |
| 6525 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6526 | 0 \ |
| 6527 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6528 | -c "client hello, adding supported_point_formats extension" \ |
| 6529 | -s "found supported elliptic curves extension" \ |
| 6530 | -s "found supported point formats extension" |
| 6531 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6532 | requires_config_enabled MBEDTLS_AES_C |
| 6533 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6534 | requires_config_enabled MBEDTLS_SHA256_C |
| 6535 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6536 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6537 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6538 | "$P_CLI debug_level=3" \ |
| 6539 | 0 \ |
| 6540 | -c "found supported_point_formats extension" \ |
| 6541 | -s "server hello, supported_point_formats extension" |
| 6542 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6543 | # Tests for DTLS HelloVerifyRequest |
| 6544 | |
| 6545 | run_test "DTLS cookie: enabled" \ |
| 6546 | "$P_SRV dtls=1 debug_level=2" \ |
| 6547 | "$P_CLI dtls=1 debug_level=2" \ |
| 6548 | 0 \ |
| 6549 | -s "cookie verification failed" \ |
| 6550 | -s "cookie verification passed" \ |
| 6551 | -S "cookie verification skipped" \ |
| 6552 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6553 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6554 | -S "SSL - The requested feature is not available" |
| 6555 | |
| 6556 | run_test "DTLS cookie: disabled" \ |
| 6557 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6558 | "$P_CLI dtls=1 debug_level=2" \ |
| 6559 | 0 \ |
| 6560 | -S "cookie verification failed" \ |
| 6561 | -S "cookie verification passed" \ |
| 6562 | -s "cookie verification skipped" \ |
| 6563 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6564 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6565 | -S "SSL - The requested feature is not available" |
| 6566 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6567 | run_test "DTLS cookie: default (failing)" \ |
| 6568 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6569 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6570 | 1 \ |
| 6571 | -s "cookie verification failed" \ |
| 6572 | -S "cookie verification passed" \ |
| 6573 | -S "cookie verification skipped" \ |
| 6574 | -C "received hello verify request" \ |
| 6575 | -S "hello verification requested" \ |
| 6576 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6577 | |
| 6578 | requires_ipv6 |
| 6579 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6580 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6581 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6582 | 0 \ |
| 6583 | -s "cookie verification failed" \ |
| 6584 | -s "cookie verification passed" \ |
| 6585 | -S "cookie verification skipped" \ |
| 6586 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6587 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6588 | -S "SSL - The requested feature is not available" |
| 6589 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6590 | run_test "DTLS cookie: enabled, nbio" \ |
| 6591 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6592 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6593 | 0 \ |
| 6594 | -s "cookie verification failed" \ |
| 6595 | -s "cookie verification passed" \ |
| 6596 | -S "cookie verification skipped" \ |
| 6597 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6598 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6599 | -S "SSL - The requested feature is not available" |
| 6600 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6601 | # Tests for client reconnecting from the same port with DTLS |
| 6602 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6603 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6604 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6605 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6606 | "$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] | 6607 | 0 \ |
| 6608 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6609 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6610 | -S "Client initiated reconnection from same port" |
| 6611 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6612 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6613 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6614 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6615 | "$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] | 6616 | 0 \ |
| 6617 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6618 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6619 | -s "Client initiated reconnection from same port" |
| 6620 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6621 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6622 | 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] | 6623 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6624 | "$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] | 6625 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6626 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6627 | -s "Client initiated reconnection from same port" |
| 6628 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6629 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6630 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6631 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6632 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6633 | 0 \ |
| 6634 | -S "The operation timed out" \ |
| 6635 | -s "Client initiated reconnection from same port" |
| 6636 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6637 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6638 | "$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] | 6639 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6640 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6641 | -s "The operation timed out" \ |
| 6642 | -S "Client initiated reconnection from same port" |
| 6643 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6644 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6645 | -p "$P_PXY inject_clihlo=1" \ |
| 6646 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6647 | "$P_CLI dtls=1 exchanges=2" \ |
| 6648 | 0 \ |
| 6649 | -s "possible client reconnect from the same port" \ |
| 6650 | -S "Client initiated reconnection from same port" |
| 6651 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6652 | # Tests for various cases of client authentication with DTLS |
| 6653 | # (focused on handshake flows and message parsing) |
| 6654 | |
| 6655 | run_test "DTLS client auth: required" \ |
| 6656 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6657 | "$P_CLI dtls=1" \ |
| 6658 | 0 \ |
| 6659 | -s "Verifying peer X.509 certificate... ok" |
| 6660 | |
| 6661 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6662 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6663 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6664 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6665 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6666 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6667 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6668 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6669 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6670 | 0 \ |
| 6671 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6672 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6673 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6674 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6675 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6676 | "$P_CLI dtls=1 psk=abc124" \ |
| 6677 | 1 \ |
| 6678 | -s "SSL - Verification of the message MAC failed" \ |
| 6679 | -c "SSL - A fatal alert message was received from our peer" |
| 6680 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6681 | # Tests for receiving fragmented handshake messages with DTLS |
| 6682 | |
| 6683 | requires_gnutls |
| 6684 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6685 | "$G_SRV -u --mtu 2048 -a" \ |
| 6686 | "$P_CLI dtls=1 debug_level=2" \ |
| 6687 | 0 \ |
| 6688 | -C "found fragmented DTLS handshake message" \ |
| 6689 | -C "error" |
| 6690 | |
| 6691 | requires_gnutls |
| 6692 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6693 | "$G_SRV -u --mtu 512" \ |
| 6694 | "$P_CLI dtls=1 debug_level=2" \ |
| 6695 | 0 \ |
| 6696 | -c "found fragmented DTLS handshake message" \ |
| 6697 | -C "error" |
| 6698 | |
| 6699 | requires_gnutls |
| 6700 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6701 | "$G_SRV -u --mtu 128" \ |
| 6702 | "$P_CLI dtls=1 debug_level=2" \ |
| 6703 | 0 \ |
| 6704 | -c "found fragmented DTLS handshake message" \ |
| 6705 | -C "error" |
| 6706 | |
| 6707 | requires_gnutls |
| 6708 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6709 | "$G_SRV -u --mtu 128" \ |
| 6710 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6711 | 0 \ |
| 6712 | -c "found fragmented DTLS handshake message" \ |
| 6713 | -C "error" |
| 6714 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6715 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6716 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6717 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6718 | "$G_SRV -u --mtu 256" \ |
| 6719 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6720 | 0 \ |
| 6721 | -c "found fragmented DTLS handshake message" \ |
| 6722 | -c "client hello, adding renegotiation extension" \ |
| 6723 | -c "found renegotiation extension" \ |
| 6724 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6725 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6726 | -C "error" \ |
| 6727 | -s "Extra-header:" |
| 6728 | |
| 6729 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6730 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6731 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6732 | "$G_SRV -u --mtu 256" \ |
| 6733 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6734 | 0 \ |
| 6735 | -c "found fragmented DTLS handshake message" \ |
| 6736 | -c "client hello, adding renegotiation extension" \ |
| 6737 | -c "found renegotiation extension" \ |
| 6738 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6739 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6740 | -C "error" \ |
| 6741 | -s "Extra-header:" |
| 6742 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6743 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6744 | "$O_SRV -dtls -mtu 2048" \ |
| 6745 | "$P_CLI dtls=1 debug_level=2" \ |
| 6746 | 0 \ |
| 6747 | -C "found fragmented DTLS handshake message" \ |
| 6748 | -C "error" |
| 6749 | |
| 6750 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6751 | "$O_SRV -dtls -mtu 768" \ |
| 6752 | "$P_CLI dtls=1 debug_level=2" \ |
| 6753 | 0 \ |
| 6754 | -c "found fragmented DTLS handshake message" \ |
| 6755 | -C "error" |
| 6756 | |
| 6757 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6758 | "$O_SRV -dtls -mtu 256" \ |
| 6759 | "$P_CLI dtls=1 debug_level=2" \ |
| 6760 | 0 \ |
| 6761 | -c "found fragmented DTLS handshake message" \ |
| 6762 | -C "error" |
| 6763 | |
| 6764 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6765 | "$O_SRV -dtls -mtu 256" \ |
| 6766 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6767 | 0 \ |
| 6768 | -c "found fragmented DTLS handshake message" \ |
| 6769 | -C "error" |
| 6770 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6771 | # Tests for sending fragmented handshake messages with DTLS |
| 6772 | # |
| 6773 | # Use client auth when we need the client to send large messages, |
| 6774 | # and use large cert chains on both sides too (the long chains we have all use |
| 6775 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6776 | # Sizes reached (UDP payload): |
| 6777 | # - 2037B for server certificate |
| 6778 | # - 1542B for client certificate |
| 6779 | # - 1013B for newsessionticket |
| 6780 | # - all others below 512B |
| 6781 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6782 | |
| 6783 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6784 | requires_config_enabled MBEDTLS_RSA_C |
| 6785 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6786 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6787 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6788 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6789 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6790 | crt_file=data_files/server7_int-ca.crt \ |
| 6791 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6792 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6793 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6794 | "$P_CLI dtls=1 debug_level=2 \ |
| 6795 | crt_file=data_files/server8_int-ca2.crt \ |
| 6796 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6797 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6798 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6799 | 0 \ |
| 6800 | -S "found fragmented DTLS handshake message" \ |
| 6801 | -C "found fragmented DTLS handshake message" \ |
| 6802 | -C "error" |
| 6803 | |
| 6804 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6805 | requires_config_enabled MBEDTLS_RSA_C |
| 6806 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6807 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6808 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6809 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6810 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6811 | crt_file=data_files/server7_int-ca.crt \ |
| 6812 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6813 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6814 | max_frag_len=1024" \ |
| 6815 | "$P_CLI dtls=1 debug_level=2 \ |
| 6816 | crt_file=data_files/server8_int-ca2.crt \ |
| 6817 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6818 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6819 | max_frag_len=2048" \ |
| 6820 | 0 \ |
| 6821 | -S "found fragmented DTLS handshake message" \ |
| 6822 | -c "found fragmented DTLS handshake message" \ |
| 6823 | -C "error" |
| 6824 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6825 | # With the MFL extension, the server has no way of forcing |
| 6826 | # the client to not exceed a certain MTU; hence, the following |
| 6827 | # test can't be replicated with an MTU proxy such as the one |
| 6828 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6829 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6830 | requires_config_enabled MBEDTLS_RSA_C |
| 6831 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6832 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6833 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6834 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6835 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6836 | crt_file=data_files/server7_int-ca.crt \ |
| 6837 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6838 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6839 | max_frag_len=512" \ |
| 6840 | "$P_CLI dtls=1 debug_level=2 \ |
| 6841 | crt_file=data_files/server8_int-ca2.crt \ |
| 6842 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6843 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6844 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6845 | 0 \ |
| 6846 | -S "found fragmented DTLS handshake message" \ |
| 6847 | -c "found fragmented DTLS handshake message" \ |
| 6848 | -C "error" |
| 6849 | |
| 6850 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6851 | requires_config_enabled MBEDTLS_RSA_C |
| 6852 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6853 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6854 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6855 | 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] | 6856 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6857 | crt_file=data_files/server7_int-ca.crt \ |
| 6858 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6859 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6860 | max_frag_len=2048" \ |
| 6861 | "$P_CLI dtls=1 debug_level=2 \ |
| 6862 | crt_file=data_files/server8_int-ca2.crt \ |
| 6863 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6864 | hs_timeout=2500-60000 \ |
| 6865 | max_frag_len=1024" \ |
| 6866 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6867 | -S "found fragmented DTLS handshake message" \ |
| 6868 | -c "found fragmented DTLS handshake message" \ |
| 6869 | -C "error" |
| 6870 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6871 | # While not required by the standard defining the MFL extension |
| 6872 | # (according to which it only applies to records, not to datagrams), |
| 6873 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6874 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6875 | # to the peer. |
| 6876 | # The next test checks that no datagrams significantly larger than the |
| 6877 | # negotiated MFL are sent. |
| 6878 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6879 | requires_config_enabled MBEDTLS_RSA_C |
| 6880 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6881 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6882 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6883 | 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] | 6884 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6885 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6886 | crt_file=data_files/server7_int-ca.crt \ |
| 6887 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6888 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6889 | max_frag_len=2048" \ |
| 6890 | "$P_CLI dtls=1 debug_level=2 \ |
| 6891 | crt_file=data_files/server8_int-ca2.crt \ |
| 6892 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6893 | hs_timeout=2500-60000 \ |
| 6894 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6895 | 0 \ |
| 6896 | -S "found fragmented DTLS handshake message" \ |
| 6897 | -c "found fragmented DTLS handshake message" \ |
| 6898 | -C "error" |
| 6899 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6900 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6901 | requires_config_enabled MBEDTLS_RSA_C |
| 6902 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6903 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6904 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6905 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6906 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6907 | crt_file=data_files/server7_int-ca.crt \ |
| 6908 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6909 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6910 | max_frag_len=2048" \ |
| 6911 | "$P_CLI dtls=1 debug_level=2 \ |
| 6912 | crt_file=data_files/server8_int-ca2.crt \ |
| 6913 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6914 | hs_timeout=2500-60000 \ |
| 6915 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6916 | 0 \ |
| 6917 | -s "found fragmented DTLS handshake message" \ |
| 6918 | -c "found fragmented DTLS handshake message" \ |
| 6919 | -C "error" |
| 6920 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6921 | # While not required by the standard defining the MFL extension |
| 6922 | # (according to which it only applies to records, not to datagrams), |
| 6923 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6924 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6925 | # to the peer. |
| 6926 | # The next test checks that no datagrams significantly larger than the |
| 6927 | # negotiated MFL are sent. |
| 6928 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6929 | requires_config_enabled MBEDTLS_RSA_C |
| 6930 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6931 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6932 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6933 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6934 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6935 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6936 | crt_file=data_files/server7_int-ca.crt \ |
| 6937 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6938 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6939 | max_frag_len=2048" \ |
| 6940 | "$P_CLI dtls=1 debug_level=2 \ |
| 6941 | crt_file=data_files/server8_int-ca2.crt \ |
| 6942 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6943 | hs_timeout=2500-60000 \ |
| 6944 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6945 | 0 \ |
| 6946 | -s "found fragmented DTLS handshake message" \ |
| 6947 | -c "found fragmented DTLS handshake message" \ |
| 6948 | -C "error" |
| 6949 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6950 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6951 | requires_config_enabled MBEDTLS_RSA_C |
| 6952 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6953 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6954 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6955 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6956 | crt_file=data_files/server7_int-ca.crt \ |
| 6957 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6958 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6959 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6960 | "$P_CLI dtls=1 debug_level=2 \ |
| 6961 | crt_file=data_files/server8_int-ca2.crt \ |
| 6962 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6963 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6964 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6965 | 0 \ |
| 6966 | -S "found fragmented DTLS handshake message" \ |
| 6967 | -C "found fragmented DTLS handshake message" \ |
| 6968 | -C "error" |
| 6969 | |
| 6970 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6971 | requires_config_enabled MBEDTLS_RSA_C |
| 6972 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6973 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6974 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6975 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6976 | crt_file=data_files/server7_int-ca.crt \ |
| 6977 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6978 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6979 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6980 | "$P_CLI dtls=1 debug_level=2 \ |
| 6981 | crt_file=data_files/server8_int-ca2.crt \ |
| 6982 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6983 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6984 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6985 | 0 \ |
| 6986 | -s "found fragmented DTLS handshake message" \ |
| 6987 | -C "found fragmented DTLS handshake message" \ |
| 6988 | -C "error" |
| 6989 | |
| 6990 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6991 | requires_config_enabled MBEDTLS_RSA_C |
| 6992 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6993 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6994 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6995 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6996 | crt_file=data_files/server7_int-ca.crt \ |
| 6997 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6998 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6999 | mtu=512" \ |
| 7000 | "$P_CLI dtls=1 debug_level=2 \ |
| 7001 | crt_file=data_files/server8_int-ca2.crt \ |
| 7002 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7003 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7004 | mtu=2048" \ |
| 7005 | 0 \ |
| 7006 | -S "found fragmented DTLS handshake message" \ |
| 7007 | -c "found fragmented DTLS handshake message" \ |
| 7008 | -C "error" |
| 7009 | |
| 7010 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7011 | requires_config_enabled MBEDTLS_RSA_C |
| 7012 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7013 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7014 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7015 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7016 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7017 | crt_file=data_files/server7_int-ca.crt \ |
| 7018 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7019 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7020 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7021 | "$P_CLI dtls=1 debug_level=2 \ |
| 7022 | crt_file=data_files/server8_int-ca2.crt \ |
| 7023 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7024 | hs_timeout=2500-60000 \ |
| 7025 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7026 | 0 \ |
| 7027 | -s "found fragmented DTLS handshake message" \ |
| 7028 | -c "found fragmented DTLS handshake message" \ |
| 7029 | -C "error" |
| 7030 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7031 | # 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] | 7032 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7033 | requires_config_enabled MBEDTLS_RSA_C |
| 7034 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7035 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7036 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7037 | requires_config_enabled MBEDTLS_AES_C |
| 7038 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7039 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7040 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7041 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7042 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7043 | crt_file=data_files/server7_int-ca.crt \ |
| 7044 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7045 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7046 | mtu=512" \ |
| 7047 | "$P_CLI dtls=1 debug_level=2 \ |
| 7048 | crt_file=data_files/server8_int-ca2.crt \ |
| 7049 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7050 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7051 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7052 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7053 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7054 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7055 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7056 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7057 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7058 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7059 | # 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] | 7060 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7061 | # retransmissions, but in some cases (like both the server and client using |
| 7062 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7063 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7064 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7065 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7066 | requires_config_enabled MBEDTLS_RSA_C |
| 7067 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7068 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7069 | requires_config_enabled MBEDTLS_AES_C |
| 7070 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7071 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7072 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7073 | -p "$P_PXY mtu=508" \ |
| 7074 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7075 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7076 | key_file=data_files/server7.key \ |
| 7077 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7078 | "$P_CLI dtls=1 debug_level=2 \ |
| 7079 | crt_file=data_files/server8_int-ca2.crt \ |
| 7080 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7081 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7082 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7083 | 0 \ |
| 7084 | -s "found fragmented DTLS handshake message" \ |
| 7085 | -c "found fragmented DTLS handshake message" \ |
| 7086 | -C "error" |
| 7087 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7088 | # 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] | 7089 | only_with_valgrind |
| 7090 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7091 | requires_config_enabled MBEDTLS_RSA_C |
| 7092 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7093 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7094 | requires_config_enabled MBEDTLS_AES_C |
| 7095 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7096 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7097 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7098 | -p "$P_PXY mtu=508" \ |
| 7099 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7100 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7101 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7102 | hs_timeout=250-10000" \ |
| 7103 | "$P_CLI dtls=1 debug_level=2 \ |
| 7104 | crt_file=data_files/server8_int-ca2.crt \ |
| 7105 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7106 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7107 | hs_timeout=250-10000" \ |
| 7108 | 0 \ |
| 7109 | -s "found fragmented DTLS handshake message" \ |
| 7110 | -c "found fragmented DTLS handshake message" \ |
| 7111 | -C "error" |
| 7112 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7113 | # 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] | 7114 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7115 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7116 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7117 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7118 | requires_config_enabled MBEDTLS_RSA_C |
| 7119 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7120 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7121 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7122 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7123 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7124 | crt_file=data_files/server7_int-ca.crt \ |
| 7125 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7126 | hs_timeout=10000-60000 \ |
| 7127 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7128 | "$P_CLI dtls=1 debug_level=2 \ |
| 7129 | crt_file=data_files/server8_int-ca2.crt \ |
| 7130 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7131 | hs_timeout=10000-60000 \ |
| 7132 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7133 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7134 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7135 | -s "found fragmented DTLS handshake message" \ |
| 7136 | -c "found fragmented DTLS handshake message" \ |
| 7137 | -C "error" |
| 7138 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7139 | # 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] | 7140 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7141 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7142 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7143 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7144 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7145 | requires_config_enabled MBEDTLS_RSA_C |
| 7146 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7147 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7148 | requires_config_enabled MBEDTLS_AES_C |
| 7149 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7150 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7151 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7152 | -p "$P_PXY mtu=512" \ |
| 7153 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7154 | crt_file=data_files/server7_int-ca.crt \ |
| 7155 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7156 | hs_timeout=10000-60000 \ |
| 7157 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7158 | "$P_CLI dtls=1 debug_level=2 \ |
| 7159 | crt_file=data_files/server8_int-ca2.crt \ |
| 7160 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7161 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7162 | hs_timeout=10000-60000 \ |
| 7163 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7164 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7165 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7166 | -s "found fragmented DTLS handshake message" \ |
| 7167 | -c "found fragmented DTLS handshake message" \ |
| 7168 | -C "error" |
| 7169 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7170 | not_with_valgrind # spurious autoreduction due to timeout |
| 7171 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7172 | requires_config_enabled MBEDTLS_RSA_C |
| 7173 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7174 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7175 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7176 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7177 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7178 | crt_file=data_files/server7_int-ca.crt \ |
| 7179 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7180 | hs_timeout=10000-60000 \ |
| 7181 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7182 | "$P_CLI dtls=1 debug_level=2 \ |
| 7183 | crt_file=data_files/server8_int-ca2.crt \ |
| 7184 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7185 | hs_timeout=10000-60000 \ |
| 7186 | mtu=1024 nbio=2" \ |
| 7187 | 0 \ |
| 7188 | -S "autoreduction" \ |
| 7189 | -s "found fragmented DTLS handshake message" \ |
| 7190 | -c "found fragmented DTLS handshake message" \ |
| 7191 | -C "error" |
| 7192 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7193 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7194 | not_with_valgrind # spurious autoreduction due to timeout |
| 7195 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7196 | requires_config_enabled MBEDTLS_RSA_C |
| 7197 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7198 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7199 | requires_config_enabled MBEDTLS_AES_C |
| 7200 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7201 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7202 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7203 | -p "$P_PXY mtu=512" \ |
| 7204 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7205 | crt_file=data_files/server7_int-ca.crt \ |
| 7206 | key_file=data_files/server7.key \ |
| 7207 | hs_timeout=10000-60000 \ |
| 7208 | mtu=512 nbio=2" \ |
| 7209 | "$P_CLI dtls=1 debug_level=2 \ |
| 7210 | crt_file=data_files/server8_int-ca2.crt \ |
| 7211 | key_file=data_files/server8.key \ |
| 7212 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7213 | hs_timeout=10000-60000 \ |
| 7214 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7215 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7216 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7217 | -s "found fragmented DTLS handshake message" \ |
| 7218 | -c "found fragmented DTLS handshake message" \ |
| 7219 | -C "error" |
| 7220 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7221 | # 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] | 7222 | # This ensures things still work after session_reset(). |
| 7223 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7224 | # Since we don't support reading fragmented ClientHello yet, |
| 7225 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7226 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7227 | # An autoreduction on the client-side might happen if the server is |
| 7228 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7229 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7230 | # resumed listening, which would result in a spurious autoreduction. |
| 7231 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7232 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7233 | requires_config_enabled MBEDTLS_RSA_C |
| 7234 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7235 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7236 | requires_config_enabled MBEDTLS_AES_C |
| 7237 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7238 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7239 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7240 | -p "$P_PXY mtu=1450" \ |
| 7241 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7242 | crt_file=data_files/server7_int-ca.crt \ |
| 7243 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7244 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7245 | mtu=1450" \ |
| 7246 | "$P_CLI dtls=1 debug_level=2 \ |
| 7247 | crt_file=data_files/server8_int-ca2.crt \ |
| 7248 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7249 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7250 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7251 | 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] | 7252 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7253 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7254 | -s "found fragmented DTLS handshake message" \ |
| 7255 | -c "found fragmented DTLS handshake message" \ |
| 7256 | -C "error" |
| 7257 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7258 | # An autoreduction on the client-side might happen if the server is |
| 7259 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7260 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7261 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7262 | requires_config_enabled MBEDTLS_RSA_C |
| 7263 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7264 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7265 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7266 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7267 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7268 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7269 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7270 | -p "$P_PXY mtu=512" \ |
| 7271 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7272 | crt_file=data_files/server7_int-ca.crt \ |
| 7273 | key_file=data_files/server7.key \ |
| 7274 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7275 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7276 | mtu=512" \ |
| 7277 | "$P_CLI dtls=1 debug_level=2 \ |
| 7278 | crt_file=data_files/server8_int-ca2.crt \ |
| 7279 | key_file=data_files/server8.key \ |
| 7280 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7281 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7282 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7283 | mtu=512" \ |
| 7284 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7285 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7286 | -s "found fragmented DTLS handshake message" \ |
| 7287 | -c "found fragmented DTLS handshake message" \ |
| 7288 | -C "error" |
| 7289 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7290 | # An autoreduction on the client-side might happen if the server is |
| 7291 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7292 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7293 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7294 | requires_config_enabled MBEDTLS_RSA_C |
| 7295 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7296 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7297 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7298 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7299 | requires_config_enabled MBEDTLS_AES_C |
| 7300 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7301 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7302 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7303 | -p "$P_PXY mtu=512" \ |
| 7304 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7305 | crt_file=data_files/server7_int-ca.crt \ |
| 7306 | key_file=data_files/server7.key \ |
| 7307 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7308 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7309 | mtu=512" \ |
| 7310 | "$P_CLI dtls=1 debug_level=2 \ |
| 7311 | crt_file=data_files/server8_int-ca2.crt \ |
| 7312 | key_file=data_files/server8.key \ |
| 7313 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7314 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7315 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7316 | mtu=512" \ |
| 7317 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7318 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7319 | -s "found fragmented DTLS handshake message" \ |
| 7320 | -c "found fragmented DTLS handshake message" \ |
| 7321 | -C "error" |
| 7322 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7323 | # An autoreduction on the client-side might happen if the server is |
| 7324 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7325 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7326 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7327 | requires_config_enabled MBEDTLS_RSA_C |
| 7328 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7329 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7330 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7331 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7332 | requires_config_enabled MBEDTLS_AES_C |
| 7333 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7334 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7335 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7336 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7337 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7338 | crt_file=data_files/server7_int-ca.crt \ |
| 7339 | key_file=data_files/server7.key \ |
| 7340 | exchanges=2 renegotiation=1 \ |
| 7341 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7342 | hs_timeout=10000-60000 \ |
| 7343 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7344 | "$P_CLI dtls=1 debug_level=2 \ |
| 7345 | crt_file=data_files/server8_int-ca2.crt \ |
| 7346 | key_file=data_files/server8.key \ |
| 7347 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7348 | hs_timeout=10000-60000 \ |
| 7349 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7350 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7351 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7352 | -s "found fragmented DTLS handshake message" \ |
| 7353 | -c "found fragmented DTLS handshake message" \ |
| 7354 | -C "error" |
| 7355 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7356 | # An autoreduction on the client-side might happen if the server is |
| 7357 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7358 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7359 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7360 | requires_config_enabled MBEDTLS_RSA_C |
| 7361 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7362 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7363 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7364 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7365 | requires_config_enabled MBEDTLS_AES_C |
| 7366 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7367 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7368 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7369 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7370 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7371 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7372 | crt_file=data_files/server7_int-ca.crt \ |
| 7373 | key_file=data_files/server7.key \ |
| 7374 | exchanges=2 renegotiation=1 \ |
| 7375 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7376 | hs_timeout=10000-60000 \ |
| 7377 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7378 | "$P_CLI dtls=1 debug_level=2 \ |
| 7379 | crt_file=data_files/server8_int-ca2.crt \ |
| 7380 | key_file=data_files/server8.key \ |
| 7381 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7382 | hs_timeout=10000-60000 \ |
| 7383 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7384 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7385 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7386 | -s "found fragmented DTLS handshake message" \ |
| 7387 | -c "found fragmented DTLS handshake message" \ |
| 7388 | -C "error" |
| 7389 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7390 | # An autoreduction on the client-side might happen if the server is |
| 7391 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7392 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7393 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7394 | requires_config_enabled MBEDTLS_RSA_C |
| 7395 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7396 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7397 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7398 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7399 | requires_config_enabled MBEDTLS_AES_C |
| 7400 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7401 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7402 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7403 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7404 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7405 | crt_file=data_files/server7_int-ca.crt \ |
| 7406 | key_file=data_files/server7.key \ |
| 7407 | exchanges=2 renegotiation=1 \ |
| 7408 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7409 | hs_timeout=10000-60000 \ |
| 7410 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7411 | "$P_CLI dtls=1 debug_level=2 \ |
| 7412 | crt_file=data_files/server8_int-ca2.crt \ |
| 7413 | key_file=data_files/server8.key \ |
| 7414 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7415 | hs_timeout=10000-60000 \ |
| 7416 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7417 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7418 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7419 | -s "found fragmented DTLS handshake message" \ |
| 7420 | -c "found fragmented DTLS handshake message" \ |
| 7421 | -C "error" |
| 7422 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7423 | # 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] | 7424 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7425 | requires_config_enabled MBEDTLS_RSA_C |
| 7426 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7427 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7428 | requires_config_enabled MBEDTLS_AES_C |
| 7429 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7430 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7431 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7432 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7433 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7434 | "$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] | 7435 | crt_file=data_files/server7_int-ca.crt \ |
| 7436 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7437 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7438 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7439 | crt_file=data_files/server8_int-ca2.crt \ |
| 7440 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7441 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7442 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7443 | 0 \ |
| 7444 | -s "found fragmented DTLS handshake message" \ |
| 7445 | -c "found fragmented DTLS handshake message" \ |
| 7446 | -C "error" |
| 7447 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7448 | # 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] | 7449 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7450 | requires_config_enabled MBEDTLS_RSA_C |
| 7451 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7452 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7453 | requires_config_enabled MBEDTLS_AES_C |
| 7454 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7455 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7456 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7457 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7458 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7459 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7460 | crt_file=data_files/server7_int-ca.crt \ |
| 7461 | key_file=data_files/server7.key \ |
| 7462 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7463 | "$P_CLI dtls=1 debug_level=2 \ |
| 7464 | crt_file=data_files/server8_int-ca2.crt \ |
| 7465 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7466 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7467 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7468 | 0 \ |
| 7469 | -s "found fragmented DTLS handshake message" \ |
| 7470 | -c "found fragmented DTLS handshake message" \ |
| 7471 | -C "error" |
| 7472 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7473 | # interop tests for DTLS fragmentating with reliable connection |
| 7474 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7475 | # here and below we just want to test that the we fragment in a way that |
| 7476 | # pleases other implementations, so we don't need the peer to fragment |
| 7477 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7478 | requires_config_enabled MBEDTLS_RSA_C |
| 7479 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7480 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7481 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7482 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7483 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7484 | "$G_SRV -u" \ |
| 7485 | "$P_CLI dtls=1 debug_level=2 \ |
| 7486 | crt_file=data_files/server8_int-ca2.crt \ |
| 7487 | key_file=data_files/server8.key \ |
| 7488 | mtu=512 force_version=dtls1_2" \ |
| 7489 | 0 \ |
| 7490 | -c "fragmenting handshake message" \ |
| 7491 | -C "error" |
| 7492 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7493 | # We use --insecure for the GnuTLS client because it expects |
| 7494 | # the hostname / IP it connects to to be the name used in the |
| 7495 | # certificate obtained from the server. Here, however, it |
| 7496 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7497 | # as the server name in the certificate. This will make the |
| 7498 | # certifiate validation fail, but passing --insecure makes |
| 7499 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7500 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7501 | requires_config_enabled MBEDTLS_RSA_C |
| 7502 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7504 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7505 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7506 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7507 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7508 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7509 | crt_file=data_files/server7_int-ca.crt \ |
| 7510 | key_file=data_files/server7.key \ |
| 7511 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7512 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7513 | 0 \ |
| 7514 | -s "fragmenting handshake message" |
| 7515 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7516 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7517 | requires_config_enabled MBEDTLS_RSA_C |
| 7518 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7520 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7521 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7522 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7523 | "$P_CLI dtls=1 debug_level=2 \ |
| 7524 | crt_file=data_files/server8_int-ca2.crt \ |
| 7525 | key_file=data_files/server8.key \ |
| 7526 | mtu=512 force_version=dtls1_2" \ |
| 7527 | 0 \ |
| 7528 | -c "fragmenting handshake message" \ |
| 7529 | -C "error" |
| 7530 | |
| 7531 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7532 | requires_config_enabled MBEDTLS_RSA_C |
| 7533 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7535 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7536 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7537 | "$P_SRV dtls=1 debug_level=2 \ |
| 7538 | crt_file=data_files/server7_int-ca.crt \ |
| 7539 | key_file=data_files/server7.key \ |
| 7540 | mtu=512 force_version=dtls1_2" \ |
| 7541 | "$O_CLI -dtls1_2" \ |
| 7542 | 0 \ |
| 7543 | -s "fragmenting handshake message" |
| 7544 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7545 | # interop tests for DTLS fragmentating with unreliable connection |
| 7546 | # |
| 7547 | # again we just want to test that the we fragment in a way that |
| 7548 | # pleases other implementations, so we don't need the peer to fragment |
| 7549 | requires_gnutls_next |
| 7550 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7551 | requires_config_enabled MBEDTLS_RSA_C |
| 7552 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7554 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7555 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7556 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7557 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7558 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7559 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7560 | crt_file=data_files/server8_int-ca2.crt \ |
| 7561 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7562 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7563 | 0 \ |
| 7564 | -c "fragmenting handshake message" \ |
| 7565 | -C "error" |
| 7566 | |
| 7567 | requires_gnutls_next |
| 7568 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7569 | requires_config_enabled MBEDTLS_RSA_C |
| 7570 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7572 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7573 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7574 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7575 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7576 | "$P_SRV dtls=1 debug_level=2 \ |
| 7577 | crt_file=data_files/server7_int-ca.crt \ |
| 7578 | key_file=data_files/server7.key \ |
| 7579 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7580 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7581 | 0 \ |
| 7582 | -s "fragmenting handshake message" |
| 7583 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7584 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7585 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7586 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7587 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7588 | ## (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] | 7589 | skip_next_test |
| 7590 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7591 | requires_config_enabled MBEDTLS_RSA_C |
| 7592 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7593 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7594 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7595 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7596 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7597 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7598 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7599 | "$P_CLI dtls=1 debug_level=2 \ |
| 7600 | crt_file=data_files/server8_int-ca2.crt \ |
| 7601 | key_file=data_files/server8.key \ |
| 7602 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7603 | 0 \ |
| 7604 | -c "fragmenting handshake message" \ |
| 7605 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7606 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7607 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7608 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7609 | requires_config_enabled MBEDTLS_RSA_C |
| 7610 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7611 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7612 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7613 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7614 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7615 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7616 | "$P_SRV dtls=1 debug_level=2 \ |
| 7617 | crt_file=data_files/server7_int-ca.crt \ |
| 7618 | key_file=data_files/server7.key \ |
| 7619 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7620 | "$O_CLI -dtls1_2" \ |
| 7621 | 0 \ |
| 7622 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7623 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7624 | # Tests for DTLS-SRTP (RFC 5764) |
| 7625 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7626 | run_test "DTLS-SRTP all profiles supported" \ |
| 7627 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7628 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7629 | 0 \ |
| 7630 | -s "found use_srtp extension" \ |
| 7631 | -s "found srtp profile" \ |
| 7632 | -s "selected srtp profile" \ |
| 7633 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7634 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7635 | -c "client hello, adding use_srtp extension" \ |
| 7636 | -c "found use_srtp extension" \ |
| 7637 | -c "found srtp profile" \ |
| 7638 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7639 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7640 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7641 | -C "error" |
| 7642 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7643 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7644 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7645 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7646 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7647 | "$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] | 7648 | 0 \ |
| 7649 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7650 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7651 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7652 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7653 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7654 | -c "client hello, adding use_srtp extension" \ |
| 7655 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7656 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7657 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7658 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7659 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7660 | -C "error" |
| 7661 | |
| 7662 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7663 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7664 | "$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] | 7665 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7666 | 0 \ |
| 7667 | -s "found use_srtp extension" \ |
| 7668 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7669 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7670 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7671 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7672 | -c "client hello, adding use_srtp extension" \ |
| 7673 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7674 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7675 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7676 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7677 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7678 | -C "error" |
| 7679 | |
| 7680 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7681 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7682 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7683 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7684 | 0 \ |
| 7685 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7686 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7687 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7688 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7689 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7690 | -c "client hello, adding use_srtp extension" \ |
| 7691 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7692 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7693 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7694 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7695 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7696 | -C "error" |
| 7697 | |
| 7698 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7699 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 7700 | "$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] | 7701 | "$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] | 7702 | 0 \ |
| 7703 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7704 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7705 | -S "selected srtp profile" \ |
| 7706 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7707 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7708 | -c "client hello, adding use_srtp extension" \ |
| 7709 | -C "found use_srtp extension" \ |
| 7710 | -C "found srtp profile" \ |
| 7711 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7712 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7713 | -C "error" |
| 7714 | |
| 7715 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7716 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7717 | "$P_SRV dtls=1 debug_level=3" \ |
| 7718 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7719 | 0 \ |
| 7720 | -s "found use_srtp extension" \ |
| 7721 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7722 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7723 | -c "client hello, adding use_srtp extension" \ |
| 7724 | -C "found use_srtp extension" \ |
| 7725 | -C "found srtp profile" \ |
| 7726 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7727 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7728 | -C "error" |
| 7729 | |
| 7730 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7731 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 7732 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 7733 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7734 | 0 \ |
| 7735 | -s "found use_srtp extension" \ |
| 7736 | -s "found srtp profile" \ |
| 7737 | -s "selected srtp profile" \ |
| 7738 | -s "server hello, adding use_srtp extension" \ |
| 7739 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7740 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7741 | -c "client hello, adding use_srtp extension" \ |
| 7742 | -c "found use_srtp extension" \ |
| 7743 | -c "found srtp profile" \ |
| 7744 | -c "selected srtp profile" \ |
| 7745 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7746 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7747 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7748 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7749 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7750 | -C "error" |
| 7751 | |
| 7752 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7753 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7754 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7755 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7756 | 0 \ |
| 7757 | -s "found use_srtp extension" \ |
| 7758 | -s "found srtp profile" \ |
| 7759 | -s "selected srtp profile" \ |
| 7760 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7761 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7762 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7763 | -S "dumping 'using mki' (8 bytes)" \ |
| 7764 | -c "client hello, adding use_srtp extension" \ |
| 7765 | -c "found use_srtp extension" \ |
| 7766 | -c "found srtp profile" \ |
| 7767 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7768 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7769 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7770 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7771 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7772 | -C "dumping 'received mki' (8 bytes)" \ |
| 7773 | -C "error" |
| 7774 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7775 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7776 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7777 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7778 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7779 | 0 \ |
| 7780 | -s "found use_srtp extension" \ |
| 7781 | -s "found srtp profile" \ |
| 7782 | -s "selected srtp profile" \ |
| 7783 | -s "server hello, adding use_srtp extension" \ |
| 7784 | -s "DTLS-SRTP key material is"\ |
| 7785 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7786 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7787 | |
| 7788 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7789 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7790 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7791 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7792 | 0 \ |
| 7793 | -s "found use_srtp extension" \ |
| 7794 | -s "found srtp profile" \ |
| 7795 | -s "selected srtp profile" \ |
| 7796 | -s "server hello, adding use_srtp extension" \ |
| 7797 | -s "DTLS-SRTP key material is"\ |
| 7798 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7799 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7800 | |
| 7801 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7802 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7803 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7804 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7805 | 0 \ |
| 7806 | -s "found use_srtp extension" \ |
| 7807 | -s "found srtp profile" \ |
| 7808 | -s "selected srtp profile" \ |
| 7809 | -s "server hello, adding use_srtp extension" \ |
| 7810 | -s "DTLS-SRTP key material is"\ |
| 7811 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7812 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7813 | |
| 7814 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7815 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7816 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7817 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7818 | 0 \ |
| 7819 | -s "found use_srtp extension" \ |
| 7820 | -s "found srtp profile" \ |
| 7821 | -s "selected srtp profile" \ |
| 7822 | -s "server hello, adding use_srtp extension" \ |
| 7823 | -s "DTLS-SRTP key material is"\ |
| 7824 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7825 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7826 | |
| 7827 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7828 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7829 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7830 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7831 | 0 \ |
| 7832 | -s "found use_srtp extension" \ |
| 7833 | -s "found srtp profile" \ |
| 7834 | -s "selected srtp profile" \ |
| 7835 | -s "server hello, adding use_srtp extension" \ |
| 7836 | -s "DTLS-SRTP key material is"\ |
| 7837 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7838 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7839 | |
| 7840 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7841 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7842 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7843 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7844 | 0 \ |
| 7845 | -s "found use_srtp extension" \ |
| 7846 | -s "found srtp profile" \ |
| 7847 | -S "selected srtp profile" \ |
| 7848 | -S "server hello, adding use_srtp extension" \ |
| 7849 | -S "DTLS-SRTP key material is"\ |
| 7850 | -C "SRTP Extension negotiated, profile" |
| 7851 | |
| 7852 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7853 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7854 | "$P_SRV dtls=1 debug_level=3" \ |
| 7855 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7856 | 0 \ |
| 7857 | -s "found use_srtp extension" \ |
| 7858 | -S "server hello, adding use_srtp extension" \ |
| 7859 | -S "DTLS-SRTP key material is"\ |
| 7860 | -C "SRTP Extension negotiated, profile" |
| 7861 | |
| 7862 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7863 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7864 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7865 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7866 | 0 \ |
| 7867 | -c "client hello, adding use_srtp extension" \ |
| 7868 | -c "found use_srtp extension" \ |
| 7869 | -c "found srtp profile" \ |
| 7870 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7871 | -c "DTLS-SRTP key material is"\ |
| 7872 | -C "error" |
| 7873 | |
| 7874 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7875 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7876 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7877 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7878 | 0 \ |
| 7879 | -c "client hello, adding use_srtp extension" \ |
| 7880 | -c "found use_srtp extension" \ |
| 7881 | -c "found srtp profile" \ |
| 7882 | -c "selected srtp profile" \ |
| 7883 | -c "DTLS-SRTP key material is"\ |
| 7884 | -C "error" |
| 7885 | |
| 7886 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7887 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7888 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7889 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7890 | 0 \ |
| 7891 | -c "client hello, adding use_srtp extension" \ |
| 7892 | -c "found use_srtp extension" \ |
| 7893 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7894 | -c "selected srtp profile" \ |
| 7895 | -c "DTLS-SRTP key material is"\ |
| 7896 | -C "error" |
| 7897 | |
| 7898 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7899 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7900 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7901 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7902 | 0 \ |
| 7903 | -c "client hello, adding use_srtp extension" \ |
| 7904 | -c "found use_srtp extension" \ |
| 7905 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7906 | -c "selected srtp profile" \ |
| 7907 | -c "DTLS-SRTP key material is"\ |
| 7908 | -C "error" |
| 7909 | |
| 7910 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7911 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7912 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7913 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7914 | 0 \ |
| 7915 | -c "client hello, adding use_srtp extension" \ |
| 7916 | -c "found use_srtp extension" \ |
| 7917 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7918 | -c "selected srtp profile" \ |
| 7919 | -c "DTLS-SRTP key material is"\ |
| 7920 | -C "error" |
| 7921 | |
| 7922 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7923 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 7924 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7925 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 7926 | 0 \ |
| 7927 | -c "client hello, adding use_srtp extension" \ |
| 7928 | -C "found use_srtp extension" \ |
| 7929 | -C "found srtp profile" \ |
| 7930 | -C "selected srtp profile" \ |
| 7931 | -C "DTLS-SRTP key material is"\ |
| 7932 | -C "error" |
| 7933 | |
| 7934 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7935 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 7936 | "$O_SRV -dtls" \ |
| 7937 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7938 | 0 \ |
| 7939 | -c "client hello, adding use_srtp extension" \ |
| 7940 | -C "found use_srtp extension" \ |
| 7941 | -C "found srtp profile" \ |
| 7942 | -C "selected srtp profile" \ |
| 7943 | -C "DTLS-SRTP key material is"\ |
| 7944 | -C "error" |
| 7945 | |
| 7946 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7947 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 7948 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7949 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7950 | 0 \ |
| 7951 | -c "client hello, adding use_srtp extension" \ |
| 7952 | -c "found use_srtp extension" \ |
| 7953 | -c "found srtp profile" \ |
| 7954 | -c "selected srtp profile" \ |
| 7955 | -c "DTLS-SRTP key material is"\ |
| 7956 | -c "DTLS-SRTP no mki value negotiated"\ |
| 7957 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7958 | -C "dumping 'received mki' (8 bytes)" \ |
| 7959 | -C "error" |
| 7960 | |
| 7961 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7962 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7963 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7964 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7965 | "$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] | 7966 | 0 \ |
| 7967 | -s "found use_srtp extension" \ |
| 7968 | -s "found srtp profile" \ |
| 7969 | -s "selected srtp profile" \ |
| 7970 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7971 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7972 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 7973 | |
| 7974 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7975 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7976 | 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] | 7977 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7978 | "$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] | 7979 | 0 \ |
| 7980 | -s "found use_srtp extension" \ |
| 7981 | -s "found srtp profile" \ |
| 7982 | -s "selected srtp profile" \ |
| 7983 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7984 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7985 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 7986 | |
| 7987 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7988 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7989 | 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] | 7990 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7991 | "$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] | 7992 | 0 \ |
| 7993 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7994 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7995 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7996 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7997 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7998 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7999 | |
| 8000 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8001 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8002 | 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] | 8003 | "$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] | 8004 | "$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] | 8005 | 0 \ |
| 8006 | -s "found use_srtp extension" \ |
| 8007 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8008 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8009 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8010 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8011 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8012 | |
| 8013 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8014 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8015 | 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] | 8016 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8017 | "$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] | 8018 | 0 \ |
| 8019 | -s "found use_srtp extension" \ |
| 8020 | -s "found srtp profile" \ |
| 8021 | -s "selected srtp profile" \ |
| 8022 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8023 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8024 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8025 | |
| 8026 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8027 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8028 | 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] | 8029 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8030 | "$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] | 8031 | 0 \ |
| 8032 | -s "found use_srtp extension" \ |
| 8033 | -s "found srtp profile" \ |
| 8034 | -S "selected srtp profile" \ |
| 8035 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8036 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8037 | -C "SRTP profile:" |
| 8038 | |
| 8039 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8040 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8041 | 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] | 8042 | "$P_SRV dtls=1 debug_level=3" \ |
| 8043 | "$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] | 8044 | 0 \ |
| 8045 | -s "found use_srtp extension" \ |
| 8046 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8047 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8048 | -C "SRTP profile:" |
| 8049 | |
| 8050 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8051 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8052 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8053 | "$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" \ |
| 8054 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8055 | 0 \ |
| 8056 | -c "client hello, adding use_srtp extension" \ |
| 8057 | -c "found use_srtp extension" \ |
| 8058 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8059 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8060 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8061 | -C "error" |
| 8062 | |
| 8063 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8064 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8065 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8066 | "$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" \ |
| 8067 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8068 | 0 \ |
| 8069 | -c "client hello, adding use_srtp extension" \ |
| 8070 | -c "found use_srtp extension" \ |
| 8071 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8072 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8073 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8074 | -C "error" |
| 8075 | |
| 8076 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8077 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8078 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8079 | "$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" \ |
| 8080 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8081 | 0 \ |
| 8082 | -c "client hello, adding use_srtp extension" \ |
| 8083 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8084 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8085 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8086 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8087 | -C "error" |
| 8088 | |
| 8089 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8090 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8091 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8092 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8093 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8094 | 0 \ |
| 8095 | -c "client hello, adding use_srtp extension" \ |
| 8096 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8097 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8098 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8099 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8100 | -C "error" |
| 8101 | |
| 8102 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8103 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8104 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8105 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8106 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8107 | 0 \ |
| 8108 | -c "client hello, adding use_srtp extension" \ |
| 8109 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8110 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8111 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8112 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8113 | -C "error" |
| 8114 | |
| 8115 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8116 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8117 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8118 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8119 | "$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] | 8120 | 0 \ |
| 8121 | -c "client hello, adding use_srtp extension" \ |
| 8122 | -C "found use_srtp extension" \ |
| 8123 | -C "found srtp profile" \ |
| 8124 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8125 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8126 | -C "error" |
| 8127 | |
| 8128 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8129 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8130 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8131 | "$G_SRV -u" \ |
| 8132 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8133 | 0 \ |
| 8134 | -c "client hello, adding use_srtp extension" \ |
| 8135 | -C "found use_srtp extension" \ |
| 8136 | -C "found srtp profile" \ |
| 8137 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8138 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8139 | -C "error" |
| 8140 | |
| 8141 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8142 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8143 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8144 | "$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" \ |
| 8145 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8146 | 0 \ |
| 8147 | -c "client hello, adding use_srtp extension" \ |
| 8148 | -c "found use_srtp extension" \ |
| 8149 | -c "found srtp profile" \ |
| 8150 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8151 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8152 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8153 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8154 | -c "dumping 'received mki' (8 bytes)" \ |
| 8155 | -C "error" |
| 8156 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8157 | # Tests for specific things with "unreliable" UDP connection |
| 8158 | |
| 8159 | not_with_valgrind # spurious resend due to timeout |
| 8160 | run_test "DTLS proxy: reference" \ |
| 8161 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8162 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8163 | "$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] | 8164 | 0 \ |
| 8165 | -C "replayed record" \ |
| 8166 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8167 | -C "Buffer record from epoch" \ |
| 8168 | -S "Buffer record from epoch" \ |
| 8169 | -C "ssl_buffer_message" \ |
| 8170 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8171 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8172 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8173 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8174 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8175 | -c "HTTP/1.0 200 OK" |
| 8176 | |
| 8177 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8178 | run_test "DTLS proxy: duplicate every packet" \ |
| 8179 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8180 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8181 | "$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] | 8182 | 0 \ |
| 8183 | -c "replayed record" \ |
| 8184 | -s "replayed record" \ |
| 8185 | -c "record from another epoch" \ |
| 8186 | -s "record from another epoch" \ |
| 8187 | -S "resend" \ |
| 8188 | -s "Extra-header:" \ |
| 8189 | -c "HTTP/1.0 200 OK" |
| 8190 | |
| 8191 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8192 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8193 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8194 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8195 | 0 \ |
| 8196 | -c "replayed record" \ |
| 8197 | -S "replayed record" \ |
| 8198 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8199 | -s "record from another epoch" \ |
| 8200 | -c "resend" \ |
| 8201 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8202 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8203 | -c "HTTP/1.0 200 OK" |
| 8204 | |
| 8205 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8206 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8207 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8208 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8209 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8210 | -c "next record in same datagram" \ |
| 8211 | -s "next record in same datagram" |
| 8212 | |
| 8213 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8214 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8215 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8216 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8217 | 0 \ |
| 8218 | -c "next record in same datagram" \ |
| 8219 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8220 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8221 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8222 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8223 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8224 | "$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] | 8225 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8226 | -c "discarding invalid record (mac)" \ |
| 8227 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8228 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8229 | -c "HTTP/1.0 200 OK" \ |
| 8230 | -S "too many records with bad MAC" \ |
| 8231 | -S "Verification of the message MAC failed" |
| 8232 | |
| 8233 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8234 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8235 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8236 | "$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] | 8237 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8238 | -C "discarding invalid record (mac)" \ |
| 8239 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8240 | -S "Extra-header:" \ |
| 8241 | -C "HTTP/1.0 200 OK" \ |
| 8242 | -s "too many records with bad MAC" \ |
| 8243 | -s "Verification of the message MAC failed" |
| 8244 | |
| 8245 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8246 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8247 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8248 | "$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] | 8249 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8250 | -c "discarding invalid record (mac)" \ |
| 8251 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8252 | -s "Extra-header:" \ |
| 8253 | -c "HTTP/1.0 200 OK" \ |
| 8254 | -S "too many records with bad MAC" \ |
| 8255 | -S "Verification of the message MAC failed" |
| 8256 | |
| 8257 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8258 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8259 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8260 | "$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] | 8261 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8262 | -c "discarding invalid record (mac)" \ |
| 8263 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8264 | -s "Extra-header:" \ |
| 8265 | -c "HTTP/1.0 200 OK" \ |
| 8266 | -s "too many records with bad MAC" \ |
| 8267 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8268 | |
| 8269 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8270 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8271 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8272 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8273 | 0 \ |
| 8274 | -c "record from another epoch" \ |
| 8275 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8276 | -s "Extra-header:" \ |
| 8277 | -c "HTTP/1.0 200 OK" |
| 8278 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8279 | # Tests for reordering support with DTLS |
| 8280 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8281 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8282 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8283 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8284 | hs_timeout=2500-60000" \ |
| 8285 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8286 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8287 | 0 \ |
| 8288 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8289 | -c "Next handshake message has been buffered - load"\ |
| 8290 | -S "Buffering HS message" \ |
| 8291 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8292 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8293 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8294 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8295 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8296 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8297 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8298 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8299 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8300 | hs_timeout=2500-60000" \ |
| 8301 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8302 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8303 | 0 \ |
| 8304 | -c "Buffering HS message" \ |
| 8305 | -c "found fragmented DTLS handshake message"\ |
| 8306 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8307 | -c "Next handshake message has been buffered - load"\ |
| 8308 | -S "Buffering HS message" \ |
| 8309 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8310 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8311 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8312 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8313 | -S "Remember CCS message" |
| 8314 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8315 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8316 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8317 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8318 | # while keeping the ServerKeyExchange. |
| 8319 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8320 | 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] | 8321 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8322 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8323 | hs_timeout=2500-60000" \ |
| 8324 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8325 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8326 | 0 \ |
| 8327 | -c "Buffering HS message" \ |
| 8328 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8329 | -C "attempt to make space by freeing buffered messages" \ |
| 8330 | -S "Buffering HS message" \ |
| 8331 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8332 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8333 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8334 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8335 | -S "Remember CCS message" |
| 8336 | |
| 8337 | # The size constraints ensure that the delayed certificate message can't |
| 8338 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8339 | # when dropping it first. |
| 8340 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8341 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8342 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8343 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8344 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8345 | hs_timeout=2500-60000" \ |
| 8346 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8347 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8348 | 0 \ |
| 8349 | -c "Buffering HS message" \ |
| 8350 | -c "attempt to make space by freeing buffered future messages" \ |
| 8351 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8352 | -S "Buffering HS message" \ |
| 8353 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8354 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8355 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8356 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8357 | -S "Remember CCS message" |
| 8358 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8359 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8360 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8361 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8362 | hs_timeout=2500-60000" \ |
| 8363 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8364 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8365 | 0 \ |
| 8366 | -C "Buffering HS message" \ |
| 8367 | -C "Next handshake message has been buffered - load"\ |
| 8368 | -s "Buffering HS message" \ |
| 8369 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8370 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8371 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8372 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8373 | -S "Remember CCS message" |
| 8374 | |
| 8375 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8376 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8377 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8378 | hs_timeout=2500-60000" \ |
| 8379 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8380 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8381 | 0 \ |
| 8382 | -C "Buffering HS message" \ |
| 8383 | -C "Next handshake message has been buffered - load"\ |
| 8384 | -S "Buffering HS message" \ |
| 8385 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8386 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8387 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8388 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8389 | -S "Remember CCS message" |
| 8390 | |
| 8391 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8392 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8393 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8394 | hs_timeout=2500-60000" \ |
| 8395 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8396 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8397 | 0 \ |
| 8398 | -C "Buffering HS message" \ |
| 8399 | -C "Next handshake message has been buffered - load"\ |
| 8400 | -S "Buffering HS message" \ |
| 8401 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8402 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8403 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8404 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8405 | -s "Remember CCS message" |
| 8406 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8407 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8408 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8409 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8410 | hs_timeout=2500-60000" \ |
| 8411 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8412 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8413 | 0 \ |
| 8414 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8415 | -s "Found buffered record from current epoch - load" \ |
| 8416 | -c "Buffer record from epoch 1" \ |
| 8417 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8418 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8419 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8420 | # from the server are delayed, so that the encrypted Finished message |
| 8421 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8422 | # in afterwards, the encrypted Finished message must be freed in order |
| 8423 | # to make space for the NewSessionTicket to be reassembled. |
| 8424 | # This works only in very particular circumstances: |
| 8425 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8426 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8427 | # the encrypted Finished message. |
| 8428 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8429 | # needs to be fragmented. |
| 8430 | # - All messages sent by the server must be small enough to be either sent |
| 8431 | # without fragmentation or be reassembled within the bounds of |
| 8432 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8433 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8434 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8435 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8436 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8437 | -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] | 8438 | "$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] | 8439 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8440 | 0 \ |
| 8441 | -s "Buffer record from epoch 1" \ |
| 8442 | -s "Found buffered record from current epoch - load" \ |
| 8443 | -c "Buffer record from epoch 1" \ |
| 8444 | -C "Found buffered record from current epoch - load" \ |
| 8445 | -c "Enough space available after freeing future epoch record" |
| 8446 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8447 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8448 | |
| 8449 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8450 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8451 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8452 | "$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] | 8453 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8454 | "$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] | 8455 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8456 | 0 \ |
| 8457 | -s "Extra-header:" \ |
| 8458 | -c "HTTP/1.0 200 OK" |
| 8459 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8460 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8461 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8462 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8463 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8464 | "$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] | 8465 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8466 | 0 \ |
| 8467 | -s "Extra-header:" \ |
| 8468 | -c "HTTP/1.0 200 OK" |
| 8469 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8470 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8471 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8472 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8473 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8474 | "$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] | 8475 | 0 \ |
| 8476 | -s "Extra-header:" \ |
| 8477 | -c "HTTP/1.0 200 OK" |
| 8478 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8479 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8480 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8481 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8482 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8483 | "$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] | 8484 | 0 \ |
| 8485 | -s "Extra-header:" \ |
| 8486 | -c "HTTP/1.0 200 OK" |
| 8487 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8488 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8489 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8490 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8491 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8492 | "$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] | 8493 | 0 \ |
| 8494 | -s "Extra-header:" \ |
| 8495 | -c "HTTP/1.0 200 OK" |
| 8496 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8497 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8498 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8499 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8500 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8501 | "$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] | 8502 | 0 \ |
| 8503 | -s "Extra-header:" \ |
| 8504 | -c "HTTP/1.0 200 OK" |
| 8505 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8506 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8507 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8508 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8509 | "$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] | 8510 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8511 | "$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] | 8512 | 0 \ |
| 8513 | -s "Extra-header:" \ |
| 8514 | -c "HTTP/1.0 200 OK" |
| 8515 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8516 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8517 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8518 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8519 | "$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] | 8520 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8521 | "$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] | 8522 | 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] | 8523 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8524 | 0 \ |
| 8525 | -s "a session has been resumed" \ |
| 8526 | -c "a session has been resumed" \ |
| 8527 | -s "Extra-header:" \ |
| 8528 | -c "HTTP/1.0 200 OK" |
| 8529 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8530 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8531 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8532 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8533 | "$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] | 8534 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8535 | "$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] | 8536 | 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] | 8537 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8538 | 0 \ |
| 8539 | -s "a session has been resumed" \ |
| 8540 | -c "a session has been resumed" \ |
| 8541 | -s "Extra-header:" \ |
| 8542 | -c "HTTP/1.0 200 OK" |
| 8543 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8544 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8545 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8546 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8547 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8548 | "$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] | 8549 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8550 | "$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] | 8551 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8552 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8553 | 0 \ |
| 8554 | -c "=> renegotiate" \ |
| 8555 | -s "=> renegotiate" \ |
| 8556 | -s "Extra-header:" \ |
| 8557 | -c "HTTP/1.0 200 OK" |
| 8558 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8559 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8560 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8561 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8562 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8563 | "$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] | 8564 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8565 | "$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] | 8566 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8567 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8568 | 0 \ |
| 8569 | -c "=> renegotiate" \ |
| 8570 | -s "=> renegotiate" \ |
| 8571 | -s "Extra-header:" \ |
| 8572 | -c "HTTP/1.0 200 OK" |
| 8573 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8574 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8575 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8576 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8577 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8578 | "$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] | 8579 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8580 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8581 | "$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] | 8582 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8583 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8584 | 0 \ |
| 8585 | -c "=> renegotiate" \ |
| 8586 | -s "=> renegotiate" \ |
| 8587 | -s "Extra-header:" \ |
| 8588 | -c "HTTP/1.0 200 OK" |
| 8589 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8590 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8591 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8592 | 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] | 8593 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8594 | "$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] | 8595 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8596 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8597 | "$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] | 8598 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8599 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8600 | 0 \ |
| 8601 | -c "=> renegotiate" \ |
| 8602 | -s "=> renegotiate" \ |
| 8603 | -s "Extra-header:" \ |
| 8604 | -c "HTTP/1.0 200 OK" |
| 8605 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8606 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8607 | ## all versions installed on the CI machines), reported here: |
| 8608 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8609 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8610 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8611 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8612 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8613 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8614 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8615 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8616 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8617 | "$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] | 8618 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8619 | -c "HTTP/1.0 200 OK" |
| 8620 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8621 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8622 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8623 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8624 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8625 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8626 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8627 | "$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] | 8628 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8629 | -c "HTTP/1.0 200 OK" |
| 8630 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8631 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8632 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8633 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8634 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8635 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8636 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8637 | "$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] | 8638 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8639 | -c "HTTP/1.0 200 OK" |
| 8640 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8641 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8642 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8643 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8644 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8645 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8646 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8647 | "$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] | 8648 | 0 \ |
| 8649 | -s "Extra-header:" \ |
| 8650 | -c "Extra-header:" |
| 8651 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8652 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8653 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8654 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8655 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8656 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8657 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8658 | "$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] | 8659 | 0 \ |
| 8660 | -s "Extra-header:" \ |
| 8661 | -c "Extra-header:" |
| 8662 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8663 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8664 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8665 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8666 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8667 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8668 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8669 | "$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] | 8670 | 0 \ |
| 8671 | -s "Extra-header:" \ |
| 8672 | -c "Extra-header:" |
| 8673 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8674 | run_test "export keys functionality" \ |
| 8675 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8676 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8677 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8678 | -c "EAP-TLS key material is:"\ |
| 8679 | -s "EAP-TLS key material is:"\ |
| 8680 | -c "EAP-TLS IV is:" \ |
| 8681 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8682 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8683 | # openssl feature tests: check if tls1.3 exists. |
| 8684 | requires_openssl_tls1_3 |
| 8685 | run_test "TLS1.3: Test openssl tls1_3 feature" \ |
| 8686 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 8687 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 8688 | 0 \ |
| 8689 | -c "TLS 1.3" \ |
| 8690 | -s "TLS 1.3" |
| 8691 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 8692 | # 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] | 8693 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8694 | requires_gnutls_next_no_ticket |
| 8695 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8696 | run_test "TLS1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8697 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 8698 | "$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] | 8699 | 0 \ |
| 8700 | -s "Version: TLS1.3" \ |
| 8701 | -c "Version: TLS1.3" |
| 8702 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8703 | # TLS1.3 test cases |
| 8704 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 8705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8707 | skip_handshake_stage_check |
| 8708 | run_test "TLS1.3: Not supported version check: tls1_2 and tls1_3" \ |
| 8709 | "$P_SRV debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8710 | "$P_CLI debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8711 | 1 \ |
| 8712 | -s "SSL - The requested feature is not available" \ |
| 8713 | -c "SSL - The requested feature is not available" \ |
| 8714 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 8715 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 8716 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8719 | run_test "TLS1.3: handshake dispatch test: tls1_3 only" \ |
Jerry Yu | 3523a3b | 2021-09-14 16:29:49 +0800 | [diff] [blame] | 8720 | "$P_SRV debug_level=2 min_version=tls1_3 max_version=tls1_3" \ |
| 8721 | "$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] | 8722 | 1 \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8723 | -s "tls1_3 server state: 0" \ |
| 8724 | -c "tls1_3 client state: 0" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8725 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8726 | requires_openssl_tls1_3 |
| 8727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8728 | run_test "TLS1.3: Test client hello msg work - openssl" \ |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8729 | "$O_NEXT_SRV -tls1_3 -msg" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8730 | "$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] | 8731 | 1 \ |
| 8732 | -c "SSL - The requested feature is not available" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8733 | -s "ServerHello" \ |
| 8734 | -c "tls1_3 client state: 0" \ |
| 8735 | -c "tls1_3 client state: 2" \ |
| 8736 | -c "tls1_3 client state: 19" \ |
| 8737 | -c "tls1_3 client state: 5" \ |
| 8738 | -c "tls1_3 client state: 3" \ |
| 8739 | -c "tls1_3 client state: 9" \ |
| 8740 | -c "tls1_3 client state: 13" \ |
| 8741 | -c "tls1_3 client state: 7" \ |
| 8742 | -c "tls1_3 client state: 20" \ |
| 8743 | -c "tls1_3 client state: 11" \ |
| 8744 | -c "tls1_3 client state: 14" \ |
| 8745 | -c "tls1_3 client state: 15" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8746 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8747 | requires_gnutls_tls1_3 |
| 8748 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8749 | run_test "TLS1.3: Test client hello msg work - gnutls" \ |
| 8750 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --debug=4" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8751 | "$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] | 8752 | 1 \ |
| 8753 | -c "SSL - The requested feature is not available" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8754 | -s "SERVER HELLO was queued" \ |
| 8755 | -c "tls1_3 client state: 0" \ |
| 8756 | -c "tls1_3 client state: 2" \ |
| 8757 | -c "tls1_3 client state: 19" \ |
| 8758 | -c "tls1_3 client state: 5" \ |
| 8759 | -c "tls1_3 client state: 3" \ |
| 8760 | -c "tls1_3 client state: 9" \ |
| 8761 | -c "tls1_3 client state: 13" \ |
| 8762 | -c "tls1_3 client state: 7" \ |
| 8763 | -c "tls1_3 client state: 20" \ |
| 8764 | -c "tls1_3 client state: 11" \ |
| 8765 | -c "tls1_3 client state: 14" \ |
| 8766 | -c "tls1_3 client state: 15" |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8767 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8768 | # Test heap memory usage after handshake |
| 8769 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8770 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8771 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8772 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8773 | run_tests_memory_after_hanshake |
| 8774 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8775 | # Final report |
| 8776 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8777 | echo "------------------------------------------------------------------------" |
| 8778 | |
| 8779 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8780 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8781 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8782 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8783 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8784 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8785 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8786 | |
| 8787 | exit $FAILS |