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 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame^] | 555 | # True if the presence of the given pattern in a log definitely indicates |
| 556 | # that the test has failed. False if the presence is inconclusive. |
| 557 | # |
| 558 | # Inputs: |
| 559 | # * $1: pattern found in the logs |
| 560 | # * $TIMES_LEFT: >0 if retrying is an option |
| 561 | # |
| 562 | # Outputs: |
| 563 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 564 | # unchanged otherwise. |
| 565 | # * Return value: 1 if the pattern is inconclusive, |
| 566 | # 0 if the failure is definitive. |
| 567 | log_pattern_presence_is_conclusive() { |
| 568 | # If we've run out of attempts, then don't retry no matter what. |
| 569 | if [ $TIMES_LEFT -eq 0 ]; then |
| 570 | return 0 |
| 571 | fi |
| 572 | case $1 in |
| 573 | "resend") |
| 574 | # An undesired resend may have been caused by the OS dropping or |
| 575 | # delaying a packet at an inopportune time. |
| 576 | outcome="RETRY(resend)" |
| 577 | return 1;; |
| 578 | esac |
| 579 | } |
| 580 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 581 | # fail <message> |
| 582 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 583 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 584 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 585 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 586 | mv $SRV_OUT o-srv-${TESTS}.log |
| 587 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 588 | if [ -n "$PXY_CMD" ]; then |
| 589 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 590 | fi |
| 591 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 592 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 593 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 594 | echo " ! server output:" |
| 595 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 596 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 597 | echo " ! client output:" |
| 598 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 599 | if [ -n "$PXY_CMD" ]; then |
| 600 | echo " ! ========================================================" |
| 601 | echo " ! proxy output:" |
| 602 | cat o-pxy-${TESTS}.log |
| 603 | fi |
| 604 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 605 | fi |
| 606 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 607 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 608 | } |
| 609 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 610 | # is_polar <cmd_line> |
| 611 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 612 | case "$1" in |
| 613 | *ssl_client2*) true;; |
| 614 | *ssl_server2*) true;; |
| 615 | *) false;; |
| 616 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 617 | } |
| 618 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 619 | # openssl s_server doesn't have -www with DTLS |
| 620 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 621 | case "$SRV_CMD" in |
| 622 | *s_server*-dtls*) |
| 623 | NEEDS_INPUT=1 |
| 624 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 625 | *) NEEDS_INPUT=0;; |
| 626 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 627 | } |
| 628 | |
| 629 | # provide input to commands that need it |
| 630 | provide_input() { |
| 631 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 632 | return |
| 633 | fi |
| 634 | |
| 635 | while true; do |
| 636 | echo "HTTP/1.0 200 OK" |
| 637 | sleep 1 |
| 638 | done |
| 639 | } |
| 640 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 641 | # has_mem_err <log_file_name> |
| 642 | has_mem_err() { |
| 643 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 644 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 645 | then |
| 646 | return 1 # false: does not have errors |
| 647 | else |
| 648 | return 0 # true: has errors |
| 649 | fi |
| 650 | } |
| 651 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 652 | # 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] | 653 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 654 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 655 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 656 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 657 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 658 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 659 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 660 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 661 | # Make a tight loop, server normally takes less than 1s to start. |
| 662 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 663 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 664 | echo "$3 START TIMEOUT" |
| 665 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 666 | break |
| 667 | fi |
| 668 | # Linux and *BSD support decimal arguments to sleep. On other |
| 669 | # OSes this may be a tight loop. |
| 670 | sleep 0.1 2>/dev/null || true |
| 671 | done |
| 672 | } |
| 673 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 674 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 675 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 676 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 677 | } |
| 678 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 679 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 680 | # Wait for server process $2 to be listening on port $1. |
| 681 | wait_server_start() { |
| 682 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 683 | } |
| 684 | |
| 685 | # Wait for proxy process $2 to be listening on port $1. |
| 686 | wait_proxy_start() { |
| 687 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 688 | } |
| 689 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 690 | # 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] | 691 | # 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] | 692 | # acceptable bounds |
| 693 | check_server_hello_time() { |
| 694 | # 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] | 695 | 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] | 696 | # Get the Unix timestamp for now |
| 697 | CUR_TIME=$(date +'%s') |
| 698 | THRESHOLD_IN_SECS=300 |
| 699 | |
| 700 | # Check if the ServerHello time was printed |
| 701 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 702 | return 1 |
| 703 | fi |
| 704 | |
| 705 | # Check the time in ServerHello is within acceptable bounds |
| 706 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 707 | # The time in ServerHello is at least 5 minutes before now |
| 708 | return 1 |
| 709 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 710 | # 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] | 711 | return 1 |
| 712 | else |
| 713 | return 0 |
| 714 | fi |
| 715 | } |
| 716 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 717 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 718 | handshake_memory_get() { |
| 719 | OUTPUT_VARIABLE="$1" |
| 720 | OUTPUT_FILE="$2" |
| 721 | |
| 722 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 723 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 724 | |
| 725 | # Check if memory usage was read |
| 726 | if [ -z "$MEM_USAGE" ]; then |
| 727 | echo "Error: Can not read the value of handshake memory usage" |
| 728 | return 1 |
| 729 | else |
| 730 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 731 | return 0 |
| 732 | fi |
| 733 | } |
| 734 | |
| 735 | # Get handshake memory usage from server or client output and check if this value |
| 736 | # is not higher than the maximum given by the first argument |
| 737 | handshake_memory_check() { |
| 738 | MAX_MEMORY="$1" |
| 739 | OUTPUT_FILE="$2" |
| 740 | |
| 741 | # Get memory usage |
| 742 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 743 | return 1 |
| 744 | fi |
| 745 | |
| 746 | # Check if memory usage is below max value |
| 747 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 748 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 749 | "but should be below $MAX_MEMORY bytes" |
| 750 | return 1 |
| 751 | else |
| 752 | return 0 |
| 753 | fi |
| 754 | } |
| 755 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 756 | # wait for client to terminate and set CLI_EXIT |
| 757 | # must be called right after starting the client |
| 758 | wait_client_done() { |
| 759 | CLI_PID=$! |
| 760 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 761 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 762 | CLI_DELAY_FACTOR=1 |
| 763 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 764 | ( 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] | 765 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 766 | |
| 767 | wait $CLI_PID |
| 768 | CLI_EXIT=$? |
| 769 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 770 | kill $DOG_PID >/dev/null 2>&1 |
| 771 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 772 | |
| 773 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 774 | |
| 775 | sleep $SRV_DELAY_SECONDS |
| 776 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 777 | } |
| 778 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 779 | # check if the given command uses dtls and sets global variable DTLS |
| 780 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 781 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 782 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 783 | *) DTLS=0;; |
| 784 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 785 | } |
| 786 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 787 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 788 | is_gnutls() { |
| 789 | case "$1" in |
| 790 | *gnutls-cli*) |
| 791 | CMD_IS_GNUTLS=1 |
| 792 | ;; |
| 793 | *gnutls-serv*) |
| 794 | CMD_IS_GNUTLS=1 |
| 795 | ;; |
| 796 | *) |
| 797 | CMD_IS_GNUTLS=0 |
| 798 | ;; |
| 799 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 800 | } |
| 801 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 802 | # Compare file content |
| 803 | # Usage: find_in_both pattern file1 file2 |
| 804 | # extract from file1 the first line matching the pattern |
| 805 | # check in file2 that the same line can be found |
| 806 | find_in_both() { |
| 807 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 808 | if [ -z "$srv_pattern" ]; then |
| 809 | return 1; |
| 810 | fi |
| 811 | |
| 812 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 813 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 814 | else |
| 815 | return 1; |
| 816 | fi |
| 817 | } |
| 818 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 819 | SKIP_HANDSHAKE_CHECK="NO" |
| 820 | skip_handshake_stage_check() { |
| 821 | SKIP_HANDSHAKE_CHECK="YES" |
| 822 | } |
| 823 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 824 | # Analyze the commands that will be used in a test. |
| 825 | # |
| 826 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 827 | # extra arguments or go through wrappers. |
| 828 | # Set $DTLS (0=TLS, 1=DTLS). |
| 829 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 830 | # update DTLS variable |
| 831 | detect_dtls "$SRV_CMD" |
| 832 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 833 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 834 | # 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] | 835 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 836 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 837 | case " $SRV_CMD " in |
| 838 | *' server_addr=::1 '*) |
| 839 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 840 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 841 | fi |
| 842 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 843 | # update CMD_IS_GNUTLS variable |
| 844 | is_gnutls "$SRV_CMD" |
| 845 | |
| 846 | # if the server uses gnutls but doesn't set priority, explicitly |
| 847 | # set the default priority |
| 848 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 849 | case "$SRV_CMD" in |
| 850 | *--priority*) :;; |
| 851 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 852 | esac |
| 853 | fi |
| 854 | |
| 855 | # update CMD_IS_GNUTLS variable |
| 856 | is_gnutls "$CLI_CMD" |
| 857 | |
| 858 | # if the client uses gnutls but doesn't set priority, explicitly |
| 859 | # set the default priority |
| 860 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 861 | case "$CLI_CMD" in |
| 862 | *--priority*) :;; |
| 863 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 864 | esac |
| 865 | fi |
| 866 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 867 | # fix client port |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 868 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 869 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 870 | else |
| 871 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 872 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 873 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 874 | # prepend valgrind to our commands if active |
| 875 | if [ "$MEMCHECK" -gt 0 ]; then |
| 876 | if is_polar "$SRV_CMD"; then |
| 877 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 878 | fi |
| 879 | if is_polar "$CLI_CMD"; then |
| 880 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 881 | fi |
| 882 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 883 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 884 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 885 | # Check for failure conditions after a test case. |
| 886 | # |
| 887 | # Inputs from run_test: |
| 888 | # * positional parameters: test options (see run_test documentation) |
| 889 | # * $CLI_EXIT: client return code |
| 890 | # * $CLI_EXPECT: expected client return code |
| 891 | # * $SRV_RET: server return code |
| 892 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 893 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 894 | # |
| 895 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 896 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 897 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 898 | outcome=FAIL |
| 899 | |
| 900 | if [ $TIMES_LEFT -gt 0 ] && |
| 901 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 902 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 903 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 904 | return |
| 905 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 906 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 907 | # 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] | 908 | # (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] | 909 | # expected client exit to incorrectly succeed in case of catastrophic |
| 910 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 911 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 912 | then |
| 913 | if is_polar "$SRV_CMD"; then |
| 914 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 915 | else |
| 916 | fail "server or client failed to reach handshake stage" |
| 917 | return |
| 918 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 919 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 920 | if is_polar "$CLI_CMD"; then |
| 921 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 922 | else |
| 923 | fail "server or client failed to reach handshake stage" |
| 924 | return |
| 925 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 926 | fi |
| 927 | fi |
| 928 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 929 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 930 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 931 | # exit with status 0 when interrupted by a signal, and we don't really |
| 932 | # care anyway), in case e.g. the server reports a memory leak. |
| 933 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 934 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 935 | return |
| 936 | fi |
| 937 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 938 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 939 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 940 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 941 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 942 | 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] | 943 | return |
| 944 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 945 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 946 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 947 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 948 | # 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] | 949 | while [ $# -gt 0 ] |
| 950 | do |
| 951 | case $1 in |
| 952 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 953 | 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] | 954 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 955 | return |
| 956 | fi |
| 957 | ;; |
| 958 | |
| 959 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 960 | 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] | 961 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 962 | return |
| 963 | fi |
| 964 | ;; |
| 965 | |
| 966 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 967 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame^] | 968 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 969 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 970 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 971 | return |
| 972 | fi |
| 973 | ;; |
| 974 | |
| 975 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 976 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame^] | 977 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 978 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 979 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 980 | return |
| 981 | fi |
| 982 | ;; |
| 983 | |
| 984 | # The filtering in the following two options (-u and -U) do the following |
| 985 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 986 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 987 | # - keep one of each non-unique line |
| 988 | # - count how many lines remain |
| 989 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 990 | # if there were no duplicates. |
| 991 | "-U") |
| 992 | 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 |
| 993 | fail "lines following pattern '$2' must be unique in Server output" |
| 994 | return |
| 995 | fi |
| 996 | ;; |
| 997 | |
| 998 | "-u") |
| 999 | 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 |
| 1000 | 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] | 1001 | return |
| 1002 | fi |
| 1003 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1004 | "-F") |
| 1005 | if ! $2 "$SRV_OUT"; then |
| 1006 | fail "function call to '$2' failed on Server output" |
| 1007 | return |
| 1008 | fi |
| 1009 | ;; |
| 1010 | "-f") |
| 1011 | if ! $2 "$CLI_OUT"; then |
| 1012 | fail "function call to '$2' failed on Client output" |
| 1013 | return |
| 1014 | fi |
| 1015 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1016 | "-g") |
| 1017 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1018 | fail "function call to '$2' failed on Server and Client output" |
| 1019 | return |
| 1020 | fi |
| 1021 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1022 | |
| 1023 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1024 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1025 | exit 1 |
| 1026 | esac |
| 1027 | shift 2 |
| 1028 | done |
| 1029 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1030 | # check valgrind's results |
| 1031 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1032 | 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] | 1033 | fail "Server has memory errors" |
| 1034 | return |
| 1035 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1036 | 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] | 1037 | fail "Client has memory errors" |
| 1038 | return |
| 1039 | fi |
| 1040 | fi |
| 1041 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1042 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1043 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1044 | } |
| 1045 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1046 | # Run the current test case: start the server and if applicable the proxy, run |
| 1047 | # the client, wait for all processes to finish or time out. |
| 1048 | # |
| 1049 | # Inputs: |
| 1050 | # * $NAME: test case name |
| 1051 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1052 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1053 | # |
| 1054 | # Outputs: |
| 1055 | # * $CLI_EXIT: client return code |
| 1056 | # * $SRV_RET: server return code |
| 1057 | do_run_test_once() { |
| 1058 | # run the commands |
| 1059 | if [ -n "$PXY_CMD" ]; then |
| 1060 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1061 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1062 | PXY_PID=$! |
| 1063 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1064 | fi |
| 1065 | |
| 1066 | check_osrv_dtls |
| 1067 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1068 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1069 | SRV_PID=$! |
| 1070 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1071 | |
| 1072 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1073 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1074 | wait_client_done |
| 1075 | |
| 1076 | sleep 0.05 |
| 1077 | |
| 1078 | # terminate the server (and the proxy) |
| 1079 | kill $SRV_PID |
| 1080 | wait $SRV_PID |
| 1081 | SRV_RET=$? |
| 1082 | |
| 1083 | if [ -n "$PXY_CMD" ]; then |
| 1084 | kill $PXY_PID >/dev/null 2>&1 |
| 1085 | wait $PXY_PID |
| 1086 | fi |
| 1087 | } |
| 1088 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1089 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1090 | # Options: -s pattern pattern that must be present in server output |
| 1091 | # -c pattern pattern that must be present in client output |
| 1092 | # -u pattern lines after pattern must be unique in client output |
| 1093 | # -f call shell function on client output |
| 1094 | # -S pattern pattern that must be absent in server output |
| 1095 | # -C pattern pattern that must be absent in client output |
| 1096 | # -U pattern lines after pattern must be unique in server output |
| 1097 | # -F call shell function on server output |
| 1098 | # -g call shell function on server and client output |
| 1099 | run_test() { |
| 1100 | NAME="$1" |
| 1101 | shift 1 |
| 1102 | |
| 1103 | if is_excluded "$NAME"; then |
| 1104 | SKIP_NEXT="NO" |
| 1105 | # There was no request to run the test, so don't record its outcome. |
| 1106 | return |
| 1107 | fi |
| 1108 | |
| 1109 | print_name "$NAME" |
| 1110 | |
| 1111 | # Do we only run numbered tests? |
| 1112 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1113 | case ",$RUN_TEST_NUMBER," in |
| 1114 | *",$TESTS,"*) :;; |
| 1115 | *) SKIP_NEXT="YES";; |
| 1116 | esac |
| 1117 | fi |
| 1118 | |
| 1119 | # does this test use a proxy? |
| 1120 | if [ "X$1" = "X-p" ]; then |
| 1121 | PXY_CMD="$2" |
| 1122 | shift 2 |
| 1123 | else |
| 1124 | PXY_CMD="" |
| 1125 | fi |
| 1126 | |
| 1127 | # get commands and client output |
| 1128 | SRV_CMD="$1" |
| 1129 | CLI_CMD="$2" |
| 1130 | CLI_EXPECT="$3" |
| 1131 | shift 3 |
| 1132 | |
| 1133 | # Check if test uses files |
| 1134 | case "$SRV_CMD $CLI_CMD" in |
| 1135 | *data_files/*) |
| 1136 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1137 | esac |
| 1138 | |
| 1139 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1140 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1141 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1142 | |
| 1143 | # should we skip? |
| 1144 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1145 | SKIP_NEXT="NO" |
| 1146 | record_outcome "SKIP" |
| 1147 | SKIPS=$(( $SKIPS + 1 )) |
| 1148 | return |
| 1149 | fi |
| 1150 | |
| 1151 | analyze_test_commands "$@" |
| 1152 | |
| 1153 | TIMES_LEFT=2 |
| 1154 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1155 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1156 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1157 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1158 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1159 | check_test_failure "$@" |
| 1160 | case $outcome in |
| 1161 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1162 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1163 | FAIL) return;; |
| 1164 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1165 | done |
| 1166 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1167 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1168 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1169 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1170 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1171 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1172 | if [ -n "$PXY_CMD" ]; then |
| 1173 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1174 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1175 | fi |
| 1176 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1177 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1178 | } |
| 1179 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1180 | run_test_psa() { |
| 1181 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1182 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 1183 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 1184 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1185 | 0 \ |
| 1186 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1187 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1188 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1189 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1190 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1191 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1192 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1193 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1194 | -C "Failed to setup PSA-based cipher context"\ |
| 1195 | -S "Failed to setup PSA-based cipher context"\ |
| 1196 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1197 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1198 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1199 | -S "error" \ |
| 1200 | -C "error" |
| 1201 | } |
| 1202 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1203 | run_test_psa_force_curve() { |
| 1204 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1205 | run_test "PSA - ECDH with $1" \ |
Gilles Peskine | 12b5b38 | 2021-06-02 10:00:42 +0200 | [diff] [blame] | 1206 | "$P_SRV debug_level=4 force_version=tls1_2 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1207 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 1208 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1209 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1210 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1211 | -c "PSA calc verify" \ |
| 1212 | -c "calc PSA finished" \ |
| 1213 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1214 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1215 | -s "PSA calc verify" \ |
| 1216 | -s "calc PSA finished" \ |
| 1217 | -C "Failed to setup PSA-based cipher context"\ |
| 1218 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1219 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1220 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1221 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1222 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1223 | -C "error" |
| 1224 | } |
| 1225 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1226 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1227 | # a maximum fragment length. |
| 1228 | # first argument ($1) is MFL for SSL client |
| 1229 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1230 | run_test_memory_after_hanshake_with_mfl() |
| 1231 | { |
| 1232 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1233 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1234 | |
| 1235 | # Leave some margin for robustness |
| 1236 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1237 | |
| 1238 | run_test "Handshake memory usage (MFL $1)" \ |
| 1239 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1240 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1241 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1242 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1243 | 0 \ |
| 1244 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1245 | } |
| 1246 | |
| 1247 | |
| 1248 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1249 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1250 | run_tests_memory_after_hanshake() |
| 1251 | { |
| 1252 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1253 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1254 | |
| 1255 | # first test with default MFU is to get reference memory usage |
| 1256 | MEMORY_USAGE_MFL_16K=0 |
| 1257 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1258 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1259 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1260 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1261 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1262 | 0 \ |
| 1263 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1264 | |
| 1265 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1266 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1267 | |
| 1268 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1269 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1270 | |
| 1271 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1272 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1273 | |
| 1274 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1275 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1276 | } |
| 1277 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1278 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1279 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1280 | rm -f context_srv.txt |
| 1281 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1282 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1283 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1284 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1285 | 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] | 1286 | exit 1 |
| 1287 | } |
| 1288 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1289 | # |
| 1290 | # MAIN |
| 1291 | # |
| 1292 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1293 | get_options "$@" |
| 1294 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1295 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1296 | # patterns rather than regular expressions, use a case statement instead |
| 1297 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1298 | # detects simple cases: plain substring, everything, nothing. |
| 1299 | # |
| 1300 | # As an exception, the character '.' is treated as an ordinary character |
| 1301 | # if it is the only special character in the string. This is because it's |
| 1302 | # rare to need "any one character", but needing a literal '.' is common |
| 1303 | # (e.g. '-f "DTLS 1.2"'). |
| 1304 | need_grep= |
| 1305 | case "$FILTER" in |
| 1306 | '^$') simple_filter=;; |
| 1307 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1308 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1309 | need_grep=1;; |
| 1310 | *) # No regexp or shell-pattern special character |
| 1311 | simple_filter="*$FILTER*";; |
| 1312 | esac |
| 1313 | case "$EXCLUDE" in |
| 1314 | '^$') simple_exclude=;; |
| 1315 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1316 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1317 | need_grep=1;; |
| 1318 | *) # No regexp or shell-pattern special character |
| 1319 | simple_exclude="*$EXCLUDE*";; |
| 1320 | esac |
| 1321 | if [ -n "$need_grep" ]; then |
| 1322 | is_excluded () { |
| 1323 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1324 | } |
| 1325 | else |
| 1326 | is_excluded () { |
| 1327 | case "$1" in |
| 1328 | $simple_exclude) true;; |
| 1329 | $simple_filter) false;; |
| 1330 | *) true;; |
| 1331 | esac |
| 1332 | } |
| 1333 | fi |
| 1334 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1335 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1336 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1337 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1338 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1339 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1340 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1341 | exit 1 |
| 1342 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1343 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1344 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1345 | exit 1 |
| 1346 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1347 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1348 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1349 | exit 1 |
| 1350 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1351 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1352 | if which valgrind >/dev/null 2>&1; then :; else |
| 1353 | echo "Memcheck not possible. Valgrind not found" |
| 1354 | exit 1 |
| 1355 | fi |
| 1356 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1357 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1358 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1359 | exit 1 |
| 1360 | fi |
| 1361 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1362 | # used by watchdog |
| 1363 | MAIN_PID="$$" |
| 1364 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1365 | # We use somewhat arbitrary delays for tests: |
| 1366 | # - how long do we wait for the server to start (when lsof not available)? |
| 1367 | # - how long do we allow for the client to finish? |
| 1368 | # (not to check performance, just to avoid waiting indefinitely) |
| 1369 | # Things are slower with valgrind, so give extra time here. |
| 1370 | # |
| 1371 | # Note: without lsof, there is a trade-off between the running time of this |
| 1372 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1373 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1374 | # 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] | 1375 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1376 | START_DELAY=6 |
| 1377 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1378 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1379 | START_DELAY=2 |
| 1380 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1381 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1382 | |
| 1383 | # some particular tests need more time: |
| 1384 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1385 | # - for the server, we sleep for a number of seconds after the client exits |
| 1386 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1387 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1388 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1389 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1390 | # 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] | 1391 | # +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] | 1392 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1393 | # 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] | 1394 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1395 | 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] | 1396 | 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] | 1397 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1398 | 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] | 1399 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1400 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1401 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1402 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1403 | 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] | 1404 | 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] | 1405 | fi |
| 1406 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1407 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1408 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1409 | 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] | 1410 | fi |
| 1411 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1412 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1413 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1414 | fi |
| 1415 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1416 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1417 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1418 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1419 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1420 | # Allow SHA-1, because many of our test certificates use it |
| 1421 | P_SRV="$P_SRV allow_sha1=1" |
| 1422 | P_CLI="$P_CLI allow_sha1=1" |
| 1423 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1424 | # Also pick a unique name for intermediate files |
| 1425 | SRV_OUT="srv_out.$$" |
| 1426 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1427 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1428 | SESSION="session.$$" |
| 1429 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1430 | SKIP_NEXT="NO" |
| 1431 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1432 | trap cleanup INT TERM HUP |
| 1433 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1434 | # Basic test |
| 1435 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1436 | # Checks that: |
| 1437 | # - 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] | 1438 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1439 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1440 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1441 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1442 | "$P_CLI" \ |
| 1443 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1444 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1445 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1446 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1447 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1448 | -S "error" \ |
| 1449 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1450 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1451 | run_test "Default, DTLS" \ |
| 1452 | "$P_SRV dtls=1" \ |
| 1453 | "$P_CLI dtls=1" \ |
| 1454 | 0 \ |
| 1455 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1456 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1457 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1458 | run_test "TLS client auth: required" \ |
| 1459 | "$P_SRV auth_mode=required" \ |
| 1460 | "$P_CLI" \ |
| 1461 | 0 \ |
| 1462 | -s "Verifying peer X.509 certificate... ok" |
| 1463 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1464 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1465 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1466 | requires_config_enabled MBEDTLS_SHA256_C |
| 1467 | run_test "TLS: password protected client key" \ |
| 1468 | "$P_SRV auth_mode=required" \ |
| 1469 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1470 | 0 |
| 1471 | |
| 1472 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1473 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1474 | requires_config_enabled MBEDTLS_SHA256_C |
| 1475 | run_test "TLS: password protected server key" \ |
| 1476 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1477 | "$P_CLI" \ |
| 1478 | 0 |
| 1479 | |
| 1480 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1481 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1482 | requires_config_enabled MBEDTLS_RSA_C |
| 1483 | requires_config_enabled MBEDTLS_SHA256_C |
| 1484 | run_test "TLS: password protected server key, two certificates" \ |
| 1485 | "$P_SRV \ |
| 1486 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1487 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1488 | "$P_CLI" \ |
| 1489 | 0 |
| 1490 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1491 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1492 | run_test "CA callback on client" \ |
| 1493 | "$P_SRV debug_level=3" \ |
| 1494 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1495 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1496 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1497 | -S "error" \ |
| 1498 | -C "error" |
| 1499 | |
| 1500 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1501 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1502 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1503 | requires_config_enabled MBEDTLS_SHA256_C |
| 1504 | run_test "CA callback on server" \ |
| 1505 | "$P_SRV auth_mode=required" \ |
| 1506 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1507 | key_file=data_files/server5.key" \ |
| 1508 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1509 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1510 | -s "Verifying peer X.509 certificate... ok" \ |
| 1511 | -S "error" \ |
| 1512 | -C "error" |
| 1513 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1514 | # Test using an opaque private key for client authentication |
| 1515 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1516 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1517 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1518 | requires_config_enabled MBEDTLS_SHA256_C |
| 1519 | run_test "Opaque key for client authentication" \ |
| 1520 | "$P_SRV auth_mode=required" \ |
| 1521 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1522 | key_file=data_files/server5.key" \ |
| 1523 | 0 \ |
| 1524 | -c "key type: Opaque" \ |
| 1525 | -s "Verifying peer X.509 certificate... ok" \ |
| 1526 | -S "error" \ |
| 1527 | -C "error" |
| 1528 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1529 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1530 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1531 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1532 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1533 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1534 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1535 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1536 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1537 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1538 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1539 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1540 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1541 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1542 | run_test_psa_force_curve "secp521r1" |
| 1543 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1544 | run_test_psa_force_curve "brainpoolP512r1" |
| 1545 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1546 | run_test_psa_force_curve "secp384r1" |
| 1547 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1548 | run_test_psa_force_curve "brainpoolP384r1" |
| 1549 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1550 | run_test_psa_force_curve "secp256r1" |
| 1551 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1552 | run_test_psa_force_curve "secp256k1" |
| 1553 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1554 | run_test_psa_force_curve "brainpoolP256r1" |
| 1555 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1556 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1557 | ## SECP224K1 is buggy via the PSA API |
| 1558 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1559 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1560 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1561 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1562 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1563 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1564 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1565 | run_test_psa_force_curve "secp192r1" |
| 1566 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1567 | run_test_psa_force_curve "secp192k1" |
| 1568 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1569 | # Test current time in ServerHello |
| 1570 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1571 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1572 | "$P_SRV debug_level=3" \ |
| 1573 | "$P_CLI debug_level=3" \ |
| 1574 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1575 | -f "check_server_hello_time" \ |
| 1576 | -F "check_server_hello_time" |
| 1577 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1578 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1579 | run_test "Unique IV in GCM" \ |
| 1580 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1581 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1582 | 0 \ |
| 1583 | -u "IV used" \ |
| 1584 | -U "IV used" |
| 1585 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1586 | # Tests for certificate verification callback |
| 1587 | run_test "Configuration-specific CRT verification callback" \ |
| 1588 | "$P_SRV debug_level=3" \ |
| 1589 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1590 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1591 | -S "error" \ |
| 1592 | -c "Verify requested for " \ |
| 1593 | -c "Use configuration-specific verification callback" \ |
| 1594 | -C "Use context-specific verification callback" \ |
| 1595 | -C "error" |
| 1596 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1597 | run_test "Context-specific CRT verification callback" \ |
| 1598 | "$P_SRV debug_level=3" \ |
| 1599 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1600 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1601 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1602 | -c "Verify requested for " \ |
| 1603 | -c "Use context-specific verification callback" \ |
| 1604 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1605 | -C "error" |
| 1606 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1607 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1608 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1609 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1610 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1611 | 1 \ |
| 1612 | -c "The certificate is signed with an unacceptable hash" |
| 1613 | |
| 1614 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1615 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1616 | "$P_CLI allow_sha1=1" \ |
| 1617 | 0 |
| 1618 | |
| 1619 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1620 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1621 | "$P_CLI allow_sha1=0" \ |
| 1622 | 0 |
| 1623 | |
| 1624 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1625 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1626 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1627 | 1 \ |
| 1628 | -s "The certificate is signed with an unacceptable hash" |
| 1629 | |
| 1630 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1631 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1632 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1633 | 0 |
| 1634 | |
| 1635 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1636 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1637 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1638 | 0 |
| 1639 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1640 | # Dummy TLS 1.3 test |
| 1641 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1642 | # ssl_client2/ssl_server2 example programs works. |
| 1643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1644 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1645 | "$P_SRV tls13_kex_modes=psk" \ |
| 1646 | "$P_CLI tls13_kex_modes=psk" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1647 | 0 |
| 1648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1649 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1650 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1651 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1652 | 0 |
| 1653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1654 | 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] | 1655 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1656 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1657 | 0 |
| 1658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1659 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1660 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1661 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1662 | 0 |
| 1663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1664 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1665 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1666 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1667 | 0 |
| 1668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1669 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1670 | "$P_SRV tls13_kex_modes=all" \ |
| 1671 | "$P_CLI tls13_kex_modes=all" \ |
| 1672 | 0 |
| 1673 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1674 | # Tests for datagram packing |
| 1675 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1676 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1677 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1678 | 0 \ |
| 1679 | -c "next record in same datagram" \ |
| 1680 | -s "next record in same datagram" |
| 1681 | |
| 1682 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1683 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1684 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1685 | 0 \ |
| 1686 | -s "next record in same datagram" \ |
| 1687 | -C "next record in same datagram" |
| 1688 | |
| 1689 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1690 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1691 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1692 | 0 \ |
| 1693 | -S "next record in same datagram" \ |
| 1694 | -c "next record in same datagram" |
| 1695 | |
| 1696 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1697 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1698 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1699 | 0 \ |
| 1700 | -S "next record in same datagram" \ |
| 1701 | -C "next record in same datagram" |
| 1702 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1703 | # Tests for Context serialization |
| 1704 | |
| 1705 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1706 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1707 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1708 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1709 | 0 \ |
| 1710 | -c "Deserializing connection..." \ |
| 1711 | -S "Deserializing connection..." |
| 1712 | |
| 1713 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1714 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1715 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1716 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1717 | 0 \ |
| 1718 | -c "Deserializing connection..." \ |
| 1719 | -S "Deserializing connection..." |
| 1720 | |
| 1721 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1722 | run_test "Context serialization, client serializes, GCM" \ |
| 1723 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1724 | "$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] | 1725 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1726 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1727 | -S "Deserializing connection..." |
| 1728 | |
| 1729 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1730 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1731 | run_test "Context serialization, client serializes, with CID" \ |
| 1732 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1733 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1734 | 0 \ |
| 1735 | -c "Deserializing connection..." \ |
| 1736 | -S "Deserializing connection..." |
| 1737 | |
| 1738 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1739 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1740 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1741 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1742 | 0 \ |
| 1743 | -C "Deserializing connection..." \ |
| 1744 | -s "Deserializing connection..." |
| 1745 | |
| 1746 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1747 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1748 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1749 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1750 | 0 \ |
| 1751 | -C "Deserializing connection..." \ |
| 1752 | -s "Deserializing connection..." |
| 1753 | |
| 1754 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1755 | run_test "Context serialization, server serializes, GCM" \ |
| 1756 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1757 | "$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] | 1758 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1759 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1760 | -s "Deserializing connection..." |
| 1761 | |
| 1762 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1763 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1764 | run_test "Context serialization, server serializes, with CID" \ |
| 1765 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1766 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1767 | 0 \ |
| 1768 | -C "Deserializing connection..." \ |
| 1769 | -s "Deserializing connection..." |
| 1770 | |
| 1771 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1772 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1773 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1774 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1775 | 0 \ |
| 1776 | -c "Deserializing connection..." \ |
| 1777 | -s "Deserializing connection..." |
| 1778 | |
| 1779 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1780 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1781 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1782 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1783 | 0 \ |
| 1784 | -c "Deserializing connection..." \ |
| 1785 | -s "Deserializing connection..." |
| 1786 | |
| 1787 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1788 | run_test "Context serialization, both serialize, GCM" \ |
| 1789 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1790 | "$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] | 1791 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1792 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1793 | -s "Deserializing connection..." |
| 1794 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1795 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1796 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1797 | run_test "Context serialization, both serialize, with CID" \ |
| 1798 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1799 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1800 | 0 \ |
| 1801 | -c "Deserializing connection..." \ |
| 1802 | -s "Deserializing connection..." |
| 1803 | |
| 1804 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1805 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1806 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1807 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1808 | 0 \ |
| 1809 | -c "Deserializing connection..." \ |
| 1810 | -S "Deserializing connection..." |
| 1811 | |
| 1812 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1813 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1814 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1815 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1816 | 0 \ |
| 1817 | -c "Deserializing connection..." \ |
| 1818 | -S "Deserializing connection..." |
| 1819 | |
| 1820 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1821 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1822 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1823 | "$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] | 1824 | 0 \ |
| 1825 | -c "Deserializing connection..." \ |
| 1826 | -S "Deserializing connection..." |
| 1827 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1828 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1829 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1830 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1831 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1832 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1833 | 0 \ |
| 1834 | -c "Deserializing connection..." \ |
| 1835 | -S "Deserializing connection..." |
| 1836 | |
| 1837 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1838 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1839 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1840 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1841 | 0 \ |
| 1842 | -C "Deserializing connection..." \ |
| 1843 | -s "Deserializing connection..." |
| 1844 | |
| 1845 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1846 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1847 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1848 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1849 | 0 \ |
| 1850 | -C "Deserializing connection..." \ |
| 1851 | -s "Deserializing connection..." |
| 1852 | |
| 1853 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1854 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1855 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1856 | "$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] | 1857 | 0 \ |
| 1858 | -C "Deserializing connection..." \ |
| 1859 | -s "Deserializing connection..." |
| 1860 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1861 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1862 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1863 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1864 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1865 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1866 | 0 \ |
| 1867 | -C "Deserializing connection..." \ |
| 1868 | -s "Deserializing connection..." |
| 1869 | |
| 1870 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1871 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1872 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1873 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1874 | 0 \ |
| 1875 | -c "Deserializing connection..." \ |
| 1876 | -s "Deserializing connection..." |
| 1877 | |
| 1878 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1879 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1880 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1881 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1882 | 0 \ |
| 1883 | -c "Deserializing connection..." \ |
| 1884 | -s "Deserializing connection..." |
| 1885 | |
| 1886 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1887 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1888 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1889 | "$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] | 1890 | 0 \ |
| 1891 | -c "Deserializing connection..." \ |
| 1892 | -s "Deserializing connection..." |
| 1893 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1894 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1895 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1896 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1897 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1898 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1899 | 0 \ |
| 1900 | -c "Deserializing connection..." \ |
| 1901 | -s "Deserializing connection..." |
| 1902 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1903 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1904 | run_test "Saving the serialized context to a file" \ |
| 1905 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1906 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1907 | 0 \ |
| 1908 | -s "Save serialized context to a file... ok" \ |
| 1909 | -c "Save serialized context to a file... ok" |
| 1910 | rm -f context_srv.txt |
| 1911 | rm -f context_cli.txt |
| 1912 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1913 | # Tests for DTLS Connection ID extension |
| 1914 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1915 | # So far, the CID API isn't implemented, so we can't |
| 1916 | # grep for output witnessing its use. This needs to be |
| 1917 | # changed once the CID extension is implemented. |
| 1918 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1919 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1920 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1921 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1922 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1923 | 0 \ |
| 1924 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1925 | -s "found CID extension" \ |
| 1926 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1927 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1928 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1929 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1930 | -C "found CID extension" \ |
| 1931 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1932 | -C "Copy CIDs into SSL transform" \ |
| 1933 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1934 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1935 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1936 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1937 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1938 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1939 | 0 \ |
| 1940 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1941 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1942 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1943 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1944 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1945 | -C "found CID extension" \ |
| 1946 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1947 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1948 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1949 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1950 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1951 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1952 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1953 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1954 | 0 \ |
| 1955 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1956 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1957 | -c "client hello, adding CID extension" \ |
| 1958 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1959 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1960 | -s "server hello, adding CID extension" \ |
| 1961 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1962 | -c "Use of CID extension negotiated" \ |
| 1963 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1964 | -c "Copy CIDs into SSL transform" \ |
| 1965 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1966 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1967 | -s "Use of Connection ID has been negotiated" \ |
| 1968 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1969 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1970 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1971 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1972 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1973 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1974 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1975 | 0 \ |
| 1976 | -c "Enable use of CID extension." \ |
| 1977 | -s "Enable use of CID extension." \ |
| 1978 | -c "client hello, adding CID extension" \ |
| 1979 | -s "found CID extension" \ |
| 1980 | -s "Use of CID extension negotiated" \ |
| 1981 | -s "server hello, adding CID extension" \ |
| 1982 | -c "found CID extension" \ |
| 1983 | -c "Use of CID extension negotiated" \ |
| 1984 | -s "Copy CIDs into SSL transform" \ |
| 1985 | -c "Copy CIDs into SSL transform" \ |
| 1986 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1987 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1988 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1989 | -c "Use of Connection ID has been negotiated" \ |
| 1990 | -c "ignoring unexpected CID" \ |
| 1991 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1992 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1993 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1994 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1995 | -p "$P_PXY mtu=800" \ |
| 1996 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1997 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1998 | 0 \ |
| 1999 | -c "Enable use of CID extension." \ |
| 2000 | -s "Enable use of CID extension." \ |
| 2001 | -c "client hello, adding CID extension" \ |
| 2002 | -s "found CID extension" \ |
| 2003 | -s "Use of CID extension negotiated" \ |
| 2004 | -s "server hello, adding CID extension" \ |
| 2005 | -c "found CID extension" \ |
| 2006 | -c "Use of CID extension negotiated" \ |
| 2007 | -s "Copy CIDs into SSL transform" \ |
| 2008 | -c "Copy CIDs into SSL transform" \ |
| 2009 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2010 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2011 | -s "Use of Connection ID has been negotiated" \ |
| 2012 | -c "Use of Connection ID has been negotiated" |
| 2013 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2014 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2015 | 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] | 2016 | -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] | 2017 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2018 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2019 | 0 \ |
| 2020 | -c "Enable use of CID extension." \ |
| 2021 | -s "Enable use of CID extension." \ |
| 2022 | -c "client hello, adding CID extension" \ |
| 2023 | -s "found CID extension" \ |
| 2024 | -s "Use of CID extension negotiated" \ |
| 2025 | -s "server hello, adding CID extension" \ |
| 2026 | -c "found CID extension" \ |
| 2027 | -c "Use of CID extension negotiated" \ |
| 2028 | -s "Copy CIDs into SSL transform" \ |
| 2029 | -c "Copy CIDs into SSL transform" \ |
| 2030 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2031 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2032 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2033 | -c "Use of Connection ID has been negotiated" \ |
| 2034 | -c "ignoring unexpected CID" \ |
| 2035 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2036 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2037 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2038 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2039 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2040 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2041 | 0 \ |
| 2042 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2043 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2044 | -c "client hello, adding CID extension" \ |
| 2045 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2046 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2047 | -s "server hello, adding CID extension" \ |
| 2048 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2049 | -c "Use of CID extension negotiated" \ |
| 2050 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2051 | -c "Copy CIDs into SSL transform" \ |
| 2052 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2053 | -s "Peer CID (length 0 Bytes):" \ |
| 2054 | -s "Use of Connection ID has been negotiated" \ |
| 2055 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2056 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2057 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2058 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2059 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2060 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2061 | 0 \ |
| 2062 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2063 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2064 | -c "client hello, adding CID extension" \ |
| 2065 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2066 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2067 | -s "server hello, adding CID extension" \ |
| 2068 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2069 | -c "Use of CID extension negotiated" \ |
| 2070 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2071 | -c "Copy CIDs into SSL transform" \ |
| 2072 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2073 | -c "Peer CID (length 0 Bytes):" \ |
| 2074 | -s "Use of Connection ID has been negotiated" \ |
| 2075 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2076 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2077 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2078 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2079 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2080 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2081 | 0 \ |
| 2082 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2083 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2084 | -c "client hello, adding CID extension" \ |
| 2085 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2086 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2087 | -s "server hello, adding CID extension" \ |
| 2088 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2089 | -c "Use of CID extension negotiated" \ |
| 2090 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2091 | -c "Copy CIDs into SSL transform" \ |
| 2092 | -S "Use of Connection ID has been negotiated" \ |
| 2093 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2094 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2095 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2096 | 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] | 2097 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2098 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2099 | 0 \ |
| 2100 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2101 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2102 | -c "client hello, adding CID extension" \ |
| 2103 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2104 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2105 | -s "server hello, adding CID extension" \ |
| 2106 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2107 | -c "Use of CID extension negotiated" \ |
| 2108 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2109 | -c "Copy CIDs into SSL transform" \ |
| 2110 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2111 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2112 | -s "Use of Connection ID has been negotiated" \ |
| 2113 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2114 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2115 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2116 | 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] | 2117 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2118 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2119 | 0 \ |
| 2120 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2121 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2122 | -c "client hello, adding CID extension" \ |
| 2123 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2124 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2125 | -s "server hello, adding CID extension" \ |
| 2126 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2127 | -c "Use of CID extension negotiated" \ |
| 2128 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2129 | -c "Copy CIDs into SSL transform" \ |
| 2130 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2131 | -s "Peer CID (length 0 Bytes):" \ |
| 2132 | -s "Use of Connection ID has been negotiated" \ |
| 2133 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2134 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2135 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2136 | 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] | 2137 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2138 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2139 | 0 \ |
| 2140 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2141 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2142 | -c "client hello, adding CID extension" \ |
| 2143 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2144 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2145 | -s "server hello, adding CID extension" \ |
| 2146 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2147 | -c "Use of CID extension negotiated" \ |
| 2148 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2149 | -c "Copy CIDs into SSL transform" \ |
| 2150 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2151 | -c "Peer CID (length 0 Bytes):" \ |
| 2152 | -s "Use of Connection ID has been negotiated" \ |
| 2153 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2154 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2155 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2156 | 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] | 2157 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2158 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2159 | 0 \ |
| 2160 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2161 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2162 | -c "client hello, adding CID extension" \ |
| 2163 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2164 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2165 | -s "server hello, adding CID extension" \ |
| 2166 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2167 | -c "Use of CID extension negotiated" \ |
| 2168 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2169 | -c "Copy CIDs into SSL transform" \ |
| 2170 | -S "Use of Connection ID has been negotiated" \ |
| 2171 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2172 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2173 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2174 | 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] | 2175 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2176 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2177 | 0 \ |
| 2178 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2179 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2180 | -c "client hello, adding CID extension" \ |
| 2181 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2182 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2183 | -s "server hello, adding CID extension" \ |
| 2184 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2185 | -c "Use of CID extension negotiated" \ |
| 2186 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2187 | -c "Copy CIDs into SSL transform" \ |
| 2188 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2189 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2190 | -s "Use of Connection ID has been negotiated" \ |
| 2191 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2192 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2193 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2194 | 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] | 2195 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2196 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2197 | 0 \ |
| 2198 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2199 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2200 | -c "client hello, adding CID extension" \ |
| 2201 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2202 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2203 | -s "server hello, adding CID extension" \ |
| 2204 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2205 | -c "Use of CID extension negotiated" \ |
| 2206 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2207 | -c "Copy CIDs into SSL transform" \ |
| 2208 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2209 | -s "Peer CID (length 0 Bytes):" \ |
| 2210 | -s "Use of Connection ID has been negotiated" \ |
| 2211 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2212 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2213 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2214 | 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] | 2215 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2216 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2217 | 0 \ |
| 2218 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2219 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2220 | -c "client hello, adding CID extension" \ |
| 2221 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2222 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2223 | -s "server hello, adding CID extension" \ |
| 2224 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2225 | -c "Use of CID extension negotiated" \ |
| 2226 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2227 | -c "Copy CIDs into SSL transform" \ |
| 2228 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2229 | -c "Peer CID (length 0 Bytes):" \ |
| 2230 | -s "Use of Connection ID has been negotiated" \ |
| 2231 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2232 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2233 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2234 | 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] | 2235 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2236 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2237 | 0 \ |
| 2238 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2239 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2240 | -c "client hello, adding CID extension" \ |
| 2241 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2242 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2243 | -s "server hello, adding CID extension" \ |
| 2244 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2245 | -c "Use of CID extension negotiated" \ |
| 2246 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2247 | -c "Copy CIDs into SSL transform" \ |
| 2248 | -S "Use of Connection ID has been negotiated" \ |
| 2249 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2250 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2251 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2252 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2253 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2254 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2255 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2256 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 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): de ad" \ |
| 2262 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 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 | b42ec0d | 2019-05-03 17:30:59 +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: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2269 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2270 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2271 | 0 \ |
| 2272 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2273 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2274 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2275 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2276 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2277 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2278 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2279 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2280 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2281 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2282 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2283 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2284 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2285 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2286 | 0 \ |
| 2287 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2288 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2289 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2290 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2291 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2292 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2293 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2294 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2295 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2296 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2297 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2298 | 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] | 2299 | -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] | 2300 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2301 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2302 | 0 \ |
| 2303 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2304 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2305 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2306 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2307 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2308 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2309 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2310 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2311 | -c "ignoring unexpected CID" \ |
| 2312 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2313 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2314 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2315 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2316 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2317 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2318 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2319 | 0 \ |
| 2320 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2321 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2322 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2323 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2324 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2325 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2326 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2327 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2328 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2329 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2330 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2331 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2332 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2333 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2334 | 0 \ |
| 2335 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2336 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2337 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2338 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2339 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2340 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2341 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2342 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2343 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2344 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2345 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2346 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2347 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2348 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2349 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2350 | 0 \ |
| 2351 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2352 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2353 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2354 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2355 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2356 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2357 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2358 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2359 | -c "ignoring unexpected CID" \ |
| 2360 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2361 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2362 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2363 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2364 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2365 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2366 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2367 | 0 \ |
| 2368 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2369 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2370 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2371 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2372 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2373 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2374 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2375 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2376 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2377 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2378 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2379 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2380 | 0 \ |
| 2381 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2382 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2383 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2384 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2385 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2386 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2387 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2388 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2389 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2390 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2391 | -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] | 2392 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2393 | "$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" \ |
| 2394 | 0 \ |
| 2395 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2396 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2397 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2398 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2399 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2400 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2401 | -c "ignoring unexpected CID" \ |
| 2402 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2403 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2404 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2405 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2406 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2407 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2408 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2409 | 0 \ |
| 2410 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2411 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2412 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2413 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2414 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2415 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2416 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2417 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2418 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2419 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2420 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2421 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2422 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2423 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2424 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2425 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2426 | 0 \ |
| 2427 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2428 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2429 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2430 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2431 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2432 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2433 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2434 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2435 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2436 | -c "ignoring unexpected CID" \ |
| 2437 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2438 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2440 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2441 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2442 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2443 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2444 | 0 \ |
| 2445 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2446 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2447 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2448 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2449 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2450 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2451 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2452 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2453 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2454 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2455 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2456 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2457 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2458 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2459 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2460 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2461 | 0 \ |
| 2462 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2463 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2464 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2465 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2466 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2467 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2468 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2469 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2470 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2471 | -c "ignoring unexpected CID" \ |
| 2472 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2473 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2474 | # 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] | 2475 | # tests check that the buffer contents are reallocated when the message is |
| 2476 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2477 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2478 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2479 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2480 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2481 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2482 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2483 | 0 \ |
| 2484 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2485 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2486 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2487 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2488 | -s "Reallocating in_buf" \ |
| 2489 | -s "Reallocating out_buf" |
| 2490 | |
| 2491 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2492 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2493 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2494 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2495 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2496 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2497 | 0 \ |
| 2498 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2499 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2500 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2501 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2502 | -s "Reallocating in_buf" \ |
| 2503 | -s "Reallocating out_buf" |
| 2504 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2505 | # Tests for Encrypt-then-MAC extension |
| 2506 | |
| 2507 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2508 | "$P_SRV debug_level=3 \ |
| 2509 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2510 | "$P_CLI debug_level=3" \ |
| 2511 | 0 \ |
| 2512 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2513 | -s "found encrypt then mac extension" \ |
| 2514 | -s "server hello, adding encrypt then mac extension" \ |
| 2515 | -c "found encrypt_then_mac extension" \ |
| 2516 | -c "using encrypt then mac" \ |
| 2517 | -s "using encrypt then mac" |
| 2518 | |
| 2519 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2520 | "$P_SRV debug_level=3 etm=0 \ |
| 2521 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2522 | "$P_CLI debug_level=3 etm=1" \ |
| 2523 | 0 \ |
| 2524 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2525 | -s "found encrypt then mac extension" \ |
| 2526 | -S "server hello, adding encrypt then mac extension" \ |
| 2527 | -C "found encrypt_then_mac extension" \ |
| 2528 | -C "using encrypt then mac" \ |
| 2529 | -S "using encrypt then mac" |
| 2530 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2531 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2532 | "$P_SRV debug_level=3 etm=1 \ |
| 2533 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2534 | "$P_CLI debug_level=3 etm=1" \ |
| 2535 | 0 \ |
| 2536 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2537 | -s "found encrypt then mac extension" \ |
| 2538 | -S "server hello, adding encrypt then mac extension" \ |
| 2539 | -C "found encrypt_then_mac extension" \ |
| 2540 | -C "using encrypt then mac" \ |
| 2541 | -S "using encrypt then mac" |
| 2542 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2543 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2544 | "$P_SRV debug_level=3 etm=1 \ |
| 2545 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2546 | "$P_CLI debug_level=3 etm=0" \ |
| 2547 | 0 \ |
| 2548 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2549 | -S "found encrypt then mac extension" \ |
| 2550 | -S "server hello, adding encrypt then mac extension" \ |
| 2551 | -C "found encrypt_then_mac extension" \ |
| 2552 | -C "using encrypt then mac" \ |
| 2553 | -S "using encrypt then mac" |
| 2554 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2555 | # Tests for Extended Master Secret extension |
| 2556 | |
| 2557 | run_test "Extended Master Secret: default" \ |
| 2558 | "$P_SRV debug_level=3" \ |
| 2559 | "$P_CLI debug_level=3" \ |
| 2560 | 0 \ |
| 2561 | -c "client hello, adding extended_master_secret extension" \ |
| 2562 | -s "found extended master secret extension" \ |
| 2563 | -s "server hello, adding extended master secret extension" \ |
| 2564 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2565 | -c "session hash for extended master secret" \ |
| 2566 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2567 | |
| 2568 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2569 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2570 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2571 | 0 \ |
| 2572 | -c "client hello, adding extended_master_secret extension" \ |
| 2573 | -s "found extended master secret extension" \ |
| 2574 | -S "server hello, adding extended master secret extension" \ |
| 2575 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2576 | -C "session hash for extended master secret" \ |
| 2577 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2578 | |
| 2579 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2580 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2581 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2582 | 0 \ |
| 2583 | -C "client hello, adding extended_master_secret extension" \ |
| 2584 | -S "found extended master secret extension" \ |
| 2585 | -S "server hello, adding extended master secret extension" \ |
| 2586 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2587 | -C "session hash for extended master secret" \ |
| 2588 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2589 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2590 | # Test sending and receiving empty application data records |
| 2591 | |
| 2592 | run_test "Encrypt then MAC: empty application data record" \ |
| 2593 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2594 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2595 | 0 \ |
| 2596 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2597 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2598 | -c "0 bytes written in 1 fragments" |
| 2599 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2600 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2601 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2602 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2603 | 0 \ |
| 2604 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2605 | -c "0 bytes written in 1 fragments" |
| 2606 | |
| 2607 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2608 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2609 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2610 | 0 \ |
| 2611 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2612 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2613 | -c "0 bytes written in 1 fragments" |
| 2614 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2615 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2616 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2617 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2618 | 0 \ |
| 2619 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2620 | -c "0 bytes written in 1 fragments" |
| 2621 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2622 | # Tests for CBC 1/n-1 record splitting |
| 2623 | |
| 2624 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2625 | "$P_SRV" \ |
| 2626 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2627 | request_size=123 force_version=tls1_2" \ |
| 2628 | 0 \ |
| 2629 | -s "Read from client: 123 bytes read" \ |
| 2630 | -S "Read from client: 1 bytes read" \ |
| 2631 | -S "122 bytes read" |
| 2632 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2633 | # Tests for Session Tickets |
| 2634 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2635 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2636 | "$P_SRV debug_level=3 tickets=1" \ |
| 2637 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2638 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2639 | -c "client hello, adding session ticket extension" \ |
| 2640 | -s "found session ticket extension" \ |
| 2641 | -s "server hello, adding session ticket extension" \ |
| 2642 | -c "found session_ticket extension" \ |
| 2643 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2644 | -S "session successfully restored from cache" \ |
| 2645 | -s "session successfully restored from ticket" \ |
| 2646 | -s "a session has been resumed" \ |
| 2647 | -c "a session has been resumed" |
| 2648 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2649 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2650 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2651 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2652 | 0 \ |
| 2653 | -c "client hello, adding session ticket extension" \ |
| 2654 | -s "found session ticket extension" \ |
| 2655 | -s "server hello, adding session ticket extension" \ |
| 2656 | -c "found session_ticket extension" \ |
| 2657 | -c "parse new session ticket" \ |
| 2658 | -S "session successfully restored from cache" \ |
| 2659 | -s "session successfully restored from ticket" \ |
| 2660 | -s "a session has been resumed" \ |
| 2661 | -c "a session has been resumed" |
| 2662 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2663 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2664 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2665 | "$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] | 2666 | 0 \ |
| 2667 | -c "client hello, adding session ticket extension" \ |
| 2668 | -s "found session ticket extension" \ |
| 2669 | -s "server hello, adding session ticket extension" \ |
| 2670 | -c "found session_ticket extension" \ |
| 2671 | -c "parse new session ticket" \ |
| 2672 | -S "session successfully restored from cache" \ |
| 2673 | -S "session successfully restored from ticket" \ |
| 2674 | -S "a session has been resumed" \ |
| 2675 | -C "a session has been resumed" |
| 2676 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2677 | run_test "Session resume using tickets: session copy" \ |
| 2678 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2679 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2680 | 0 \ |
| 2681 | -c "client hello, adding session ticket extension" \ |
| 2682 | -s "found session ticket extension" \ |
| 2683 | -s "server hello, adding session ticket extension" \ |
| 2684 | -c "found session_ticket extension" \ |
| 2685 | -c "parse new session ticket" \ |
| 2686 | -S "session successfully restored from cache" \ |
| 2687 | -s "session successfully restored from ticket" \ |
| 2688 | -s "a session has been resumed" \ |
| 2689 | -c "a session has been resumed" |
| 2690 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2691 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2692 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2693 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2694 | 0 \ |
| 2695 | -c "client hello, adding session ticket extension" \ |
| 2696 | -c "found session_ticket extension" \ |
| 2697 | -c "parse new session ticket" \ |
| 2698 | -c "a session has been resumed" |
| 2699 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2700 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2701 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2702 | "( $O_CLI -sess_out $SESSION; \ |
| 2703 | $O_CLI -sess_in $SESSION; \ |
| 2704 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2705 | 0 \ |
| 2706 | -s "found session ticket extension" \ |
| 2707 | -s "server hello, adding session ticket extension" \ |
| 2708 | -S "session successfully restored from cache" \ |
| 2709 | -s "session successfully restored from ticket" \ |
| 2710 | -s "a session has been resumed" |
| 2711 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2712 | # Tests for Session Tickets with DTLS |
| 2713 | |
| 2714 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2715 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2716 | "$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] | 2717 | 0 \ |
| 2718 | -c "client hello, adding session ticket extension" \ |
| 2719 | -s "found session ticket extension" \ |
| 2720 | -s "server hello, adding session ticket extension" \ |
| 2721 | -c "found session_ticket extension" \ |
| 2722 | -c "parse new session ticket" \ |
| 2723 | -S "session successfully restored from cache" \ |
| 2724 | -s "session successfully restored from ticket" \ |
| 2725 | -s "a session has been resumed" \ |
| 2726 | -c "a session has been resumed" |
| 2727 | |
| 2728 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2729 | "$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] | 2730 | "$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] | 2731 | 0 \ |
| 2732 | -c "client hello, adding session ticket extension" \ |
| 2733 | -s "found session ticket extension" \ |
| 2734 | -s "server hello, adding session ticket extension" \ |
| 2735 | -c "found session_ticket extension" \ |
| 2736 | -c "parse new session ticket" \ |
| 2737 | -S "session successfully restored from cache" \ |
| 2738 | -s "session successfully restored from ticket" \ |
| 2739 | -s "a session has been resumed" \ |
| 2740 | -c "a session has been resumed" |
| 2741 | |
| 2742 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2743 | "$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] | 2744 | "$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] | 2745 | 0 \ |
| 2746 | -c "client hello, adding session ticket extension" \ |
| 2747 | -s "found session ticket extension" \ |
| 2748 | -s "server hello, adding session ticket extension" \ |
| 2749 | -c "found session_ticket extension" \ |
| 2750 | -c "parse new session ticket" \ |
| 2751 | -S "session successfully restored from cache" \ |
| 2752 | -S "session successfully restored from ticket" \ |
| 2753 | -S "a session has been resumed" \ |
| 2754 | -C "a session has been resumed" |
| 2755 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2756 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2757 | "$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] | 2758 | "$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] | 2759 | 0 \ |
| 2760 | -c "client hello, adding session ticket extension" \ |
| 2761 | -s "found session ticket extension" \ |
| 2762 | -s "server hello, adding session ticket extension" \ |
| 2763 | -c "found session_ticket extension" \ |
| 2764 | -c "parse new session ticket" \ |
| 2765 | -S "session successfully restored from cache" \ |
| 2766 | -s "session successfully restored from ticket" \ |
| 2767 | -s "a session has been resumed" \ |
| 2768 | -c "a session has been resumed" |
| 2769 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2770 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2771 | "$O_SRV -dtls" \ |
| 2772 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2773 | 0 \ |
| 2774 | -c "client hello, adding session ticket extension" \ |
| 2775 | -c "found session_ticket extension" \ |
| 2776 | -c "parse new session ticket" \ |
| 2777 | -c "a session has been resumed" |
| 2778 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2779 | # 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] | 2780 | # 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] | 2781 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2782 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2783 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2784 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 2785 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2786 | rm -f $SESSION )" \ |
| 2787 | 0 \ |
| 2788 | -s "found session ticket extension" \ |
| 2789 | -s "server hello, adding session ticket extension" \ |
| 2790 | -S "session successfully restored from cache" \ |
| 2791 | -s "session successfully restored from ticket" \ |
| 2792 | -s "a session has been resumed" |
| 2793 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2794 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2795 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2796 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2797 | "$P_SRV debug_level=3 tickets=0" \ |
| 2798 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2799 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2800 | -c "client hello, adding session ticket extension" \ |
| 2801 | -s "found session ticket extension" \ |
| 2802 | -S "server hello, adding session ticket extension" \ |
| 2803 | -C "found session_ticket extension" \ |
| 2804 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2805 | -s "session successfully restored from cache" \ |
| 2806 | -S "session successfully restored from ticket" \ |
| 2807 | -s "a session has been resumed" \ |
| 2808 | -c "a session has been resumed" |
| 2809 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2810 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2811 | "$P_SRV debug_level=3 tickets=1" \ |
| 2812 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2813 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2814 | -C "client hello, adding session ticket extension" \ |
| 2815 | -S "found session ticket extension" \ |
| 2816 | -S "server hello, adding session ticket extension" \ |
| 2817 | -C "found session_ticket extension" \ |
| 2818 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2819 | -s "session successfully restored from cache" \ |
| 2820 | -S "session successfully restored from ticket" \ |
| 2821 | -s "a session has been resumed" \ |
| 2822 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2823 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2824 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2825 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2826 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2827 | 0 \ |
| 2828 | -S "session successfully restored from cache" \ |
| 2829 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2830 | -S "a session has been resumed" \ |
| 2831 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2832 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2833 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2834 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2835 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2836 | 0 \ |
| 2837 | -s "session successfully restored from cache" \ |
| 2838 | -S "session successfully restored from ticket" \ |
| 2839 | -s "a session has been resumed" \ |
| 2840 | -c "a session has been resumed" |
| 2841 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2842 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2843 | "$P_SRV debug_level=3 tickets=0" \ |
| 2844 | "$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] | 2845 | 0 \ |
| 2846 | -s "session successfully restored from cache" \ |
| 2847 | -S "session successfully restored from ticket" \ |
| 2848 | -s "a session has been resumed" \ |
| 2849 | -c "a session has been resumed" |
| 2850 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2851 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2852 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2853 | "$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] | 2854 | 0 \ |
| 2855 | -S "session successfully restored from cache" \ |
| 2856 | -S "session successfully restored from ticket" \ |
| 2857 | -S "a session has been resumed" \ |
| 2858 | -C "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: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2861 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2862 | "$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] | 2863 | 0 \ |
| 2864 | -s "session successfully restored from cache" \ |
| 2865 | -S "session successfully restored from ticket" \ |
| 2866 | -s "a session has been resumed" \ |
| 2867 | -c "a session has been resumed" |
| 2868 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2869 | run_test "Session resume using cache: session copy" \ |
| 2870 | "$P_SRV debug_level=3 tickets=0" \ |
| 2871 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2872 | 0 \ |
| 2873 | -s "session successfully restored from cache" \ |
| 2874 | -S "session successfully restored from ticket" \ |
| 2875 | -s "a session has been resumed" \ |
| 2876 | -c "a session has been resumed" |
| 2877 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2878 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2879 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2880 | "( $O_CLI -sess_out $SESSION; \ |
| 2881 | $O_CLI -sess_in $SESSION; \ |
| 2882 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2883 | 0 \ |
| 2884 | -s "found session ticket extension" \ |
| 2885 | -S "server hello, adding session ticket extension" \ |
| 2886 | -s "session successfully restored from cache" \ |
| 2887 | -S "session successfully restored from ticket" \ |
| 2888 | -s "a session has been resumed" |
| 2889 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2890 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2891 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2892 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2893 | 0 \ |
| 2894 | -C "found session_ticket extension" \ |
| 2895 | -C "parse new session ticket" \ |
| 2896 | -c "a session has been resumed" |
| 2897 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2898 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2899 | |
| 2900 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2901 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2902 | "$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] | 2903 | 0 \ |
| 2904 | -c "client hello, adding session ticket extension" \ |
| 2905 | -s "found session ticket extension" \ |
| 2906 | -S "server hello, adding session ticket extension" \ |
| 2907 | -C "found session_ticket extension" \ |
| 2908 | -C "parse new session ticket" \ |
| 2909 | -s "session successfully restored from cache" \ |
| 2910 | -S "session successfully restored from ticket" \ |
| 2911 | -s "a session has been resumed" \ |
| 2912 | -c "a session has been resumed" |
| 2913 | |
| 2914 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2915 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2916 | "$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] | 2917 | 0 \ |
| 2918 | -C "client hello, adding session ticket extension" \ |
| 2919 | -S "found session ticket extension" \ |
| 2920 | -S "server hello, adding session ticket extension" \ |
| 2921 | -C "found session_ticket extension" \ |
| 2922 | -C "parse new session ticket" \ |
| 2923 | -s "session successfully restored from cache" \ |
| 2924 | -S "session successfully restored from ticket" \ |
| 2925 | -s "a session has been resumed" \ |
| 2926 | -c "a session has been resumed" |
| 2927 | |
| 2928 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2929 | "$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] | 2930 | "$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] | 2931 | 0 \ |
| 2932 | -S "session successfully restored from cache" \ |
| 2933 | -S "session successfully restored from ticket" \ |
| 2934 | -S "a session has been resumed" \ |
| 2935 | -C "a session has been resumed" |
| 2936 | |
| 2937 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2938 | "$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] | 2939 | "$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] | 2940 | 0 \ |
| 2941 | -s "session successfully restored from cache" \ |
| 2942 | -S "session successfully restored from ticket" \ |
| 2943 | -s "a session has been resumed" \ |
| 2944 | -c "a session has been resumed" |
| 2945 | |
| 2946 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2947 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2948 | "$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] | 2949 | 0 \ |
| 2950 | -s "session successfully restored from cache" \ |
| 2951 | -S "session successfully restored from ticket" \ |
| 2952 | -s "a session has been resumed" \ |
| 2953 | -c "a session has been resumed" |
| 2954 | |
| 2955 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2956 | "$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] | 2957 | "$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] | 2958 | 0 \ |
| 2959 | -S "session successfully restored from cache" \ |
| 2960 | -S "session successfully restored from ticket" \ |
| 2961 | -S "a session has been resumed" \ |
| 2962 | -C "a session has been resumed" |
| 2963 | |
| 2964 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2965 | "$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] | 2966 | "$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] | 2967 | 0 \ |
| 2968 | -s "session successfully restored from cache" \ |
| 2969 | -S "session successfully restored from ticket" \ |
| 2970 | -s "a session has been resumed" \ |
| 2971 | -c "a session has been resumed" |
| 2972 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2973 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2974 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2975 | "$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] | 2976 | 0 \ |
| 2977 | -s "session successfully restored from cache" \ |
| 2978 | -S "session successfully restored from ticket" \ |
| 2979 | -s "a session has been resumed" \ |
| 2980 | -c "a session has been resumed" |
| 2981 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2982 | # 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] | 2983 | # 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] | 2984 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2985 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2986 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2987 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 2988 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2989 | rm -f $SESSION )" \ |
| 2990 | 0 \ |
| 2991 | -s "found session ticket extension" \ |
| 2992 | -S "server hello, adding session ticket extension" \ |
| 2993 | -s "session successfully restored from cache" \ |
| 2994 | -S "session successfully restored from ticket" \ |
| 2995 | -s "a session has been resumed" |
| 2996 | |
| 2997 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2998 | "$O_SRV -dtls" \ |
| 2999 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3000 | 0 \ |
| 3001 | -C "found session_ticket extension" \ |
| 3002 | -C "parse new session ticket" \ |
| 3003 | -c "a session has been resumed" |
| 3004 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3005 | # Tests for Max Fragment Length extension |
| 3006 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3007 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3008 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3009 | "$P_SRV debug_level=3" \ |
| 3010 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3011 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3012 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3013 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3014 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3015 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3016 | -C "client hello, adding max_fragment_length extension" \ |
| 3017 | -S "found max fragment length extension" \ |
| 3018 | -S "server hello, max_fragment_length extension" \ |
| 3019 | -C "found max_fragment_length extension" |
| 3020 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3021 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3022 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3023 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3024 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3025 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3026 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3027 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3028 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3029 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3030 | -C "client hello, adding max_fragment_length extension" \ |
| 3031 | -S "found max fragment length extension" \ |
| 3032 | -S "server hello, max_fragment_length extension" \ |
| 3033 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3034 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3035 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3036 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3037 | |
| 3038 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3039 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3040 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3041 | "$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] | 3042 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3043 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3044 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3045 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3046 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3047 | -C "client hello, adding max_fragment_length extension" \ |
| 3048 | -S "found max fragment length extension" \ |
| 3049 | -S "server hello, max_fragment_length extension" \ |
| 3050 | -C "found max_fragment_length extension" \ |
| 3051 | -c "fragment larger than.*maximum " |
| 3052 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3053 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3054 | # (session fragment length will be 16384 regardless of mbedtls |
| 3055 | # content length configuration.) |
| 3056 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3057 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3058 | run_test "Max fragment length: disabled, larger message" \ |
| 3059 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3060 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3061 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3062 | -C "Maximum incoming record payload length is 16384" \ |
| 3063 | -C "Maximum outgoing record payload length is 16384" \ |
| 3064 | -S "Maximum incoming record payload length is 16384" \ |
| 3065 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3066 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3067 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3068 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3069 | |
| 3070 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3071 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3072 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3073 | "$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] | 3074 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3075 | -C "Maximum incoming record payload length is 16384" \ |
| 3076 | -C "Maximum outgoing record payload length is 16384" \ |
| 3077 | -S "Maximum incoming record payload length is 16384" \ |
| 3078 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3079 | -c "fragment larger than.*maximum " |
| 3080 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3081 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3082 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3083 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3084 | "$P_SRV debug_level=3" \ |
| 3085 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3086 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3087 | -c "Maximum incoming record payload length is 4096" \ |
| 3088 | -c "Maximum outgoing record payload length is 4096" \ |
| 3089 | -s "Maximum incoming record payload length is 4096" \ |
| 3090 | -s "Maximum outgoing record payload length is 4096" \ |
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 1024 |
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 1024" \ |
| 3099 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 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 2048 |
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 512, server 2048" \ |
| 3114 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3115 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3116 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3117 | -c "Maximum incoming record payload length is 512" \ |
| 3118 | -c "Maximum outgoing record payload length is 512" \ |
| 3119 | -s "Maximum incoming record payload length is 512" \ |
| 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 4096 |
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 512, server 4096" \ |
| 3129 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3130 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3131 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3132 | -c "Maximum incoming record payload length is 512" \ |
| 3133 | -c "Maximum outgoing record payload length is 512" \ |
| 3134 | -s "Maximum incoming record payload length is 512" \ |
| 3135 | -s "Maximum outgoing record payload length is 512" \ |
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 1024 |
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 512" \ |
| 3144 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 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 512" \ |
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 1024, server 2048" \ |
| 3159 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3160 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3161 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3162 | -c "Maximum incoming record payload length is 1024" \ |
| 3163 | -c "Maximum outgoing record payload length is 1024" \ |
| 3164 | -s "Maximum incoming record payload length is 1024" \ |
| 3165 | -s "Maximum outgoing record payload length is 1024" \ |
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 4096 |
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 1024, server 4096" \ |
| 3174 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3175 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3176 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3177 | -c "Maximum incoming record payload length is 1024" \ |
| 3178 | -c "Maximum outgoing record payload length is 1024" \ |
| 3179 | -s "Maximum incoming record payload length is 1024" \ |
| 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 2048 |
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 512" \ |
| 3189 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 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 512" \ |
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 2048 |
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 2048, server 1024" \ |
| 3204 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3205 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3206 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3207 | -c "Maximum incoming record payload length is 2048" \ |
| 3208 | -c "Maximum outgoing record payload length is 2048" \ |
| 3209 | -s "Maximum incoming record payload length is 2048" \ |
| 3210 | -s "Maximum outgoing record payload length is 1024" \ |
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 2048, server 4096" \ |
| 3219 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3220 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3221 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3222 | -c "Maximum incoming record payload length is 2048" \ |
| 3223 | -c "Maximum outgoing record payload length is 2048" \ |
| 3224 | -s "Maximum incoming record payload length is 2048" \ |
| 3225 | -s "Maximum outgoing record payload length is 2048" \ |
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 512" \ |
| 3234 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 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 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [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 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3247 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3248 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3249 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3250 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3251 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3252 | -c "Maximum incoming record payload length is 4096" \ |
| 3253 | -c "Maximum outgoing record payload length is 4096" \ |
| 3254 | -s "Maximum incoming record payload length is 4096" \ |
| 3255 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [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" |
| 3260 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3261 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3262 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3263 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3264 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3265 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3266 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3267 | -c "Maximum incoming record payload length is 4096" \ |
| 3268 | -c "Maximum outgoing record payload length is 4096" \ |
| 3269 | -s "Maximum incoming record payload length is 4096" \ |
| 3270 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3271 | -c "client hello, adding max_fragment_length extension" \ |
| 3272 | -s "found max fragment length extension" \ |
| 3273 | -s "server hello, max_fragment_length extension" \ |
| 3274 | -c "found max_fragment_length extension" |
| 3275 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3276 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3277 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3278 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3279 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3280 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3281 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3282 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3283 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3284 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3285 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3286 | -C "client hello, adding max_fragment_length extension" \ |
| 3287 | -S "found max fragment length extension" \ |
| 3288 | -S "server hello, max_fragment_length extension" \ |
| 3289 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3290 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3291 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3292 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3293 | requires_gnutls |
| 3294 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3295 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3296 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3297 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3298 | -c "Maximum incoming record payload length is 4096" \ |
| 3299 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3300 | -c "client hello, adding max_fragment_length extension" \ |
| 3301 | -c "found max_fragment_length extension" |
| 3302 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3303 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3304 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3305 | run_test "Max fragment length: client, message just fits" \ |
| 3306 | "$P_SRV debug_level=3" \ |
| 3307 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3308 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3309 | -c "Maximum incoming record payload length is 2048" \ |
| 3310 | -c "Maximum outgoing record payload length is 2048" \ |
| 3311 | -s "Maximum incoming record payload length is 2048" \ |
| 3312 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3313 | -c "client hello, adding max_fragment_length extension" \ |
| 3314 | -s "found max fragment length extension" \ |
| 3315 | -s "server hello, max_fragment_length extension" \ |
| 3316 | -c "found max_fragment_length extension" \ |
| 3317 | -c "2048 bytes written in 1 fragments" \ |
| 3318 | -s "2048 bytes read" |
| 3319 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3320 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3321 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3322 | run_test "Max fragment length: client, larger message" \ |
| 3323 | "$P_SRV debug_level=3" \ |
| 3324 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3325 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3326 | -c "Maximum incoming record payload length is 2048" \ |
| 3327 | -c "Maximum outgoing record payload length is 2048" \ |
| 3328 | -s "Maximum incoming record payload length is 2048" \ |
| 3329 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3330 | -c "client hello, adding max_fragment_length extension" \ |
| 3331 | -s "found max fragment length extension" \ |
| 3332 | -s "server hello, max_fragment_length extension" \ |
| 3333 | -c "found max_fragment_length extension" \ |
| 3334 | -c "2345 bytes written in 2 fragments" \ |
| 3335 | -s "2048 bytes read" \ |
| 3336 | -s "297 bytes read" |
| 3337 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3338 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3339 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3340 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3341 | "$P_SRV debug_level=3 dtls=1" \ |
| 3342 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3343 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3344 | -c "Maximum incoming record payload length is 2048" \ |
| 3345 | -c "Maximum outgoing record payload length is 2048" \ |
| 3346 | -s "Maximum incoming record payload length is 2048" \ |
| 3347 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3348 | -c "client hello, adding max_fragment_length extension" \ |
| 3349 | -s "found max fragment length extension" \ |
| 3350 | -s "server hello, max_fragment_length extension" \ |
| 3351 | -c "found max_fragment_length extension" \ |
| 3352 | -c "fragment larger than.*maximum" |
| 3353 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3354 | # Tests for renegotiation |
| 3355 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3356 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3357 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3358 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3359 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3360 | 0 \ |
| 3361 | -C "client hello, adding renegotiation extension" \ |
| 3362 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3363 | -S "found renegotiation extension" \ |
| 3364 | -s "server hello, secure renegotiation extension" \ |
| 3365 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3366 | -C "=> renegotiate" \ |
| 3367 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3368 | -S "write hello request" |
| 3369 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3370 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3371 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3372 | "$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] | 3373 | "$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] | 3374 | 0 \ |
| 3375 | -c "client hello, adding renegotiation extension" \ |
| 3376 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3377 | -s "found renegotiation extension" \ |
| 3378 | -s "server hello, secure renegotiation extension" \ |
| 3379 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3380 | -c "=> renegotiate" \ |
| 3381 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3382 | -S "write hello request" |
| 3383 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3384 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3385 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3386 | "$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] | 3387 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3388 | 0 \ |
| 3389 | -c "client hello, adding renegotiation extension" \ |
| 3390 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3391 | -s "found renegotiation extension" \ |
| 3392 | -s "server hello, secure renegotiation extension" \ |
| 3393 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3394 | -c "=> renegotiate" \ |
| 3395 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3396 | -s "write hello request" |
| 3397 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3398 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3399 | # 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] | 3400 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3401 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3402 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3403 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3404 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3405 | 0 \ |
| 3406 | -c "client hello, adding renegotiation extension" \ |
| 3407 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3408 | -s "found renegotiation extension" \ |
| 3409 | -s "server hello, secure renegotiation extension" \ |
| 3410 | -c "found renegotiation extension" \ |
| 3411 | -c "=> renegotiate" \ |
| 3412 | -s "=> renegotiate" \ |
| 3413 | -S "write hello request" \ |
| 3414 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3415 | |
| 3416 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3417 | # 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] | 3418 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3419 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3420 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3421 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3422 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3423 | 0 \ |
| 3424 | -c "client hello, adding renegotiation extension" \ |
| 3425 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3426 | -s "found renegotiation extension" \ |
| 3427 | -s "server hello, secure renegotiation extension" \ |
| 3428 | -c "found renegotiation extension" \ |
| 3429 | -c "=> renegotiate" \ |
| 3430 | -s "=> renegotiate" \ |
| 3431 | -s "write hello request" \ |
| 3432 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3433 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3434 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3435 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3436 | "$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] | 3437 | "$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] | 3438 | 0 \ |
| 3439 | -c "client hello, adding renegotiation extension" \ |
| 3440 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3441 | -s "found renegotiation extension" \ |
| 3442 | -s "server hello, secure renegotiation extension" \ |
| 3443 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3444 | -c "=> renegotiate" \ |
| 3445 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3446 | -s "write hello request" |
| 3447 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3448 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3449 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3450 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3451 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3452 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3453 | "$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" \ |
| 3454 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3455 | -c "Maximum incoming record payload length is 2048" \ |
| 3456 | -c "Maximum outgoing record payload length is 2048" \ |
| 3457 | -s "Maximum incoming record payload length is 2048" \ |
| 3458 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3459 | -c "client hello, adding max_fragment_length extension" \ |
| 3460 | -s "found max fragment length extension" \ |
| 3461 | -s "server hello, max_fragment_length extension" \ |
| 3462 | -c "found max_fragment_length extension" \ |
| 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" \ |
| 3468 | -c "=> renegotiate" \ |
| 3469 | -s "=> renegotiate" \ |
| 3470 | -s "write hello request" |
| 3471 | |
| 3472 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3473 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3474 | "$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] | 3475 | "$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] | 3476 | 1 \ |
| 3477 | -c "client hello, adding renegotiation extension" \ |
| 3478 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3479 | -S "found renegotiation extension" \ |
| 3480 | -s "server hello, secure renegotiation extension" \ |
| 3481 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3482 | -c "=> renegotiate" \ |
| 3483 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3484 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3485 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3486 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3487 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3488 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3489 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3490 | "$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] | 3491 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3492 | 0 \ |
| 3493 | -C "client hello, adding renegotiation extension" \ |
| 3494 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3495 | -S "found renegotiation extension" \ |
| 3496 | -s "server hello, secure renegotiation extension" \ |
| 3497 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3498 | -C "=> renegotiate" \ |
| 3499 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3500 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3501 | -S "SSL - An unexpected message was received from our peer" \ |
| 3502 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3503 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3504 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3505 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3506 | "$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] | 3507 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3508 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3509 | 0 \ |
| 3510 | -C "client hello, adding renegotiation extension" \ |
| 3511 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3512 | -S "found renegotiation extension" \ |
| 3513 | -s "server hello, secure renegotiation extension" \ |
| 3514 | -c "found renegotiation extension" \ |
| 3515 | -C "=> renegotiate" \ |
| 3516 | -S "=> renegotiate" \ |
| 3517 | -s "write hello request" \ |
| 3518 | -S "SSL - An unexpected message was received from our peer" \ |
| 3519 | -S "failed" |
| 3520 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3521 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3522 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3523 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3524 | "$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] | 3525 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3526 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3527 | 0 \ |
| 3528 | -C "client hello, adding renegotiation extension" \ |
| 3529 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3530 | -S "found renegotiation extension" \ |
| 3531 | -s "server hello, secure renegotiation extension" \ |
| 3532 | -c "found renegotiation extension" \ |
| 3533 | -C "=> renegotiate" \ |
| 3534 | -S "=> renegotiate" \ |
| 3535 | -s "write hello request" \ |
| 3536 | -S "SSL - An unexpected message was received from our peer" \ |
| 3537 | -S "failed" |
| 3538 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3539 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3540 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3541 | "$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] | 3542 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3543 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3544 | 0 \ |
| 3545 | -C "client hello, adding renegotiation extension" \ |
| 3546 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3547 | -S "found renegotiation extension" \ |
| 3548 | -s "server hello, secure renegotiation extension" \ |
| 3549 | -c "found renegotiation extension" \ |
| 3550 | -C "=> renegotiate" \ |
| 3551 | -S "=> renegotiate" \ |
| 3552 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3553 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3554 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3555 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3556 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3557 | "$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] | 3558 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3559 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3560 | 0 \ |
| 3561 | -c "client hello, adding renegotiation extension" \ |
| 3562 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3563 | -s "found renegotiation extension" \ |
| 3564 | -s "server hello, secure renegotiation extension" \ |
| 3565 | -c "found renegotiation extension" \ |
| 3566 | -c "=> renegotiate" \ |
| 3567 | -s "=> renegotiate" \ |
| 3568 | -s "write hello request" \ |
| 3569 | -S "SSL - An unexpected message was received from our peer" \ |
| 3570 | -S "failed" |
| 3571 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3572 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3573 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3574 | "$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] | 3575 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3576 | 0 \ |
| 3577 | -C "client hello, adding renegotiation extension" \ |
| 3578 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3579 | -S "found renegotiation extension" \ |
| 3580 | -s "server hello, secure renegotiation extension" \ |
| 3581 | -c "found renegotiation extension" \ |
| 3582 | -S "record counter limit reached: renegotiate" \ |
| 3583 | -C "=> renegotiate" \ |
| 3584 | -S "=> renegotiate" \ |
| 3585 | -S "write hello request" \ |
| 3586 | -S "SSL - An unexpected message was received from our peer" \ |
| 3587 | -S "failed" |
| 3588 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3589 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3590 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3591 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3592 | "$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] | 3593 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3594 | 0 \ |
| 3595 | -c "client hello, adding renegotiation extension" \ |
| 3596 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3597 | -s "found renegotiation extension" \ |
| 3598 | -s "server hello, secure renegotiation extension" \ |
| 3599 | -c "found renegotiation extension" \ |
| 3600 | -s "record counter limit reached: renegotiate" \ |
| 3601 | -c "=> renegotiate" \ |
| 3602 | -s "=> renegotiate" \ |
| 3603 | -s "write hello request" \ |
| 3604 | -S "SSL - An unexpected message was received from our peer" \ |
| 3605 | -S "failed" |
| 3606 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3607 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3608 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3609 | "$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] | 3610 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3611 | 0 \ |
| 3612 | -c "client hello, adding renegotiation extension" \ |
| 3613 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3614 | -s "found renegotiation extension" \ |
| 3615 | -s "server hello, secure renegotiation extension" \ |
| 3616 | -c "found renegotiation extension" \ |
| 3617 | -s "record counter limit reached: renegotiate" \ |
| 3618 | -c "=> renegotiate" \ |
| 3619 | -s "=> renegotiate" \ |
| 3620 | -s "write hello request" \ |
| 3621 | -S "SSL - An unexpected message was received from our peer" \ |
| 3622 | -S "failed" |
| 3623 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3624 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3625 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3626 | "$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] | 3627 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3628 | 0 \ |
| 3629 | -C "client hello, adding renegotiation extension" \ |
| 3630 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3631 | -S "found renegotiation extension" \ |
| 3632 | -s "server hello, secure renegotiation extension" \ |
| 3633 | -c "found renegotiation extension" \ |
| 3634 | -S "record counter limit reached: renegotiate" \ |
| 3635 | -C "=> renegotiate" \ |
| 3636 | -S "=> renegotiate" \ |
| 3637 | -S "write hello request" \ |
| 3638 | -S "SSL - An unexpected message was received from our peer" \ |
| 3639 | -S "failed" |
| 3640 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3641 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3642 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3643 | "$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] | 3644 | "$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] | 3645 | 0 \ |
| 3646 | -c "client hello, adding renegotiation extension" \ |
| 3647 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3648 | -s "found renegotiation extension" \ |
| 3649 | -s "server hello, secure renegotiation extension" \ |
| 3650 | -c "found renegotiation extension" \ |
| 3651 | -c "=> renegotiate" \ |
| 3652 | -s "=> renegotiate" \ |
| 3653 | -S "write hello request" |
| 3654 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3655 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3656 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3657 | "$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] | 3658 | "$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] | 3659 | 0 \ |
| 3660 | -c "client hello, adding renegotiation extension" \ |
| 3661 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3662 | -s "found renegotiation extension" \ |
| 3663 | -s "server hello, secure renegotiation extension" \ |
| 3664 | -c "found renegotiation extension" \ |
| 3665 | -c "=> renegotiate" \ |
| 3666 | -s "=> renegotiate" \ |
| 3667 | -s "write hello request" |
| 3668 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3669 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3670 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3671 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3672 | "$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] | 3673 | 0 \ |
| 3674 | -c "client hello, adding renegotiation extension" \ |
| 3675 | -c "found renegotiation extension" \ |
| 3676 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3677 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3678 | -C "error" \ |
| 3679 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3680 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3681 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3682 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3683 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3684 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3685 | "$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] | 3686 | 0 \ |
| 3687 | -c "client hello, adding renegotiation extension" \ |
| 3688 | -c "found renegotiation extension" \ |
| 3689 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3690 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3691 | -C "error" \ |
| 3692 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3693 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3694 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3695 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3696 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3697 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3698 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3699 | 1 \ |
| 3700 | -c "client hello, adding renegotiation extension" \ |
| 3701 | -C "found renegotiation extension" \ |
| 3702 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3703 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3704 | -c "error" \ |
| 3705 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3706 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3707 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3708 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3709 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3710 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3711 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3712 | allow_legacy=0" \ |
| 3713 | 1 \ |
| 3714 | -c "client hello, adding renegotiation extension" \ |
| 3715 | -C "found renegotiation extension" \ |
| 3716 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3717 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3718 | -c "error" \ |
| 3719 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3720 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3721 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3722 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3723 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3724 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3725 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3726 | allow_legacy=1" \ |
| 3727 | 0 \ |
| 3728 | -c "client hello, adding renegotiation extension" \ |
| 3729 | -C "found renegotiation extension" \ |
| 3730 | -c "=> renegotiate" \ |
| 3731 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3732 | -C "error" \ |
| 3733 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3734 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3735 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3736 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3737 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3738 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3739 | 0 \ |
| 3740 | -c "client hello, adding renegotiation extension" \ |
| 3741 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3742 | -s "found renegotiation extension" \ |
| 3743 | -s "server hello, secure renegotiation extension" \ |
| 3744 | -c "found renegotiation extension" \ |
| 3745 | -c "=> renegotiate" \ |
| 3746 | -s "=> renegotiate" \ |
| 3747 | -S "write hello request" |
| 3748 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3749 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3750 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3751 | "$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] | 3752 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3753 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3754 | 0 \ |
| 3755 | -c "client hello, adding renegotiation extension" \ |
| 3756 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3757 | -s "found renegotiation extension" \ |
| 3758 | -s "server hello, secure renegotiation extension" \ |
| 3759 | -c "found renegotiation extension" \ |
| 3760 | -c "=> renegotiate" \ |
| 3761 | -s "=> renegotiate" \ |
| 3762 | -s "write hello request" |
| 3763 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3764 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3765 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3766 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3767 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3768 | 0 \ |
| 3769 | -c "client hello, adding renegotiation extension" \ |
| 3770 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3771 | -s "found renegotiation extension" \ |
| 3772 | -s "server hello, secure renegotiation extension" \ |
| 3773 | -s "record counter limit reached: renegotiate" \ |
| 3774 | -c "=> renegotiate" \ |
| 3775 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3776 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3777 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3778 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3779 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3780 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3781 | "$G_SRV -u --mtu 4096" \ |
| 3782 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3783 | 0 \ |
| 3784 | -c "client hello, adding renegotiation extension" \ |
| 3785 | -c "found renegotiation extension" \ |
| 3786 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3787 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3788 | -C "error" \ |
| 3789 | -s "Extra-header:" |
| 3790 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3791 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3792 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3793 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3794 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3795 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3796 | "$P_CLI debug_level=3" \ |
| 3797 | 0 \ |
| 3798 | -c "found renegotiation extension" \ |
| 3799 | -C "error" \ |
| 3800 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3801 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3802 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3803 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3804 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3805 | "$P_CLI debug_level=3" \ |
| 3806 | 0 \ |
| 3807 | -C "found renegotiation extension" \ |
| 3808 | -C "error" \ |
| 3809 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3810 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3811 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3812 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3813 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3814 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3815 | 1 \ |
| 3816 | -C "found renegotiation extension" \ |
| 3817 | -c "error" \ |
| 3818 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3819 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3820 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3821 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3822 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3823 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3824 | 0 \ |
| 3825 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3826 | -s "server hello, secure renegotiation extension" |
| 3827 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3828 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3829 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3830 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3831 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3832 | 0 \ |
| 3833 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3834 | -S "server hello, secure renegotiation extension" |
| 3835 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3836 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3837 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3838 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3839 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3840 | 1 \ |
| 3841 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3842 | -S "server hello, secure renegotiation extension" |
| 3843 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3844 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3845 | |
| 3846 | requires_gnutls |
| 3847 | run_test "DER format: no trailing bytes" \ |
| 3848 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3849 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3850 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3851 | 0 \ |
| 3852 | -c "Handshake was completed" \ |
| 3853 | |
| 3854 | requires_gnutls |
| 3855 | run_test "DER format: with a trailing zero byte" \ |
| 3856 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3857 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3858 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3859 | 0 \ |
| 3860 | -c "Handshake was completed" \ |
| 3861 | |
| 3862 | requires_gnutls |
| 3863 | run_test "DER format: with a trailing random byte" \ |
| 3864 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3865 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3866 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3867 | 0 \ |
| 3868 | -c "Handshake was completed" \ |
| 3869 | |
| 3870 | requires_gnutls |
| 3871 | run_test "DER format: with 2 trailing random bytes" \ |
| 3872 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3873 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3874 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3875 | 0 \ |
| 3876 | -c "Handshake was completed" \ |
| 3877 | |
| 3878 | requires_gnutls |
| 3879 | run_test "DER format: with 4 trailing random bytes" \ |
| 3880 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3881 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3882 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3883 | 0 \ |
| 3884 | -c "Handshake was completed" \ |
| 3885 | |
| 3886 | requires_gnutls |
| 3887 | run_test "DER format: with 8 trailing random bytes" \ |
| 3888 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3889 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3890 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3891 | 0 \ |
| 3892 | -c "Handshake was completed" \ |
| 3893 | |
| 3894 | requires_gnutls |
| 3895 | run_test "DER format: with 9 trailing random bytes" \ |
| 3896 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3897 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3898 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3899 | 0 \ |
| 3900 | -c "Handshake was completed" \ |
| 3901 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3902 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3903 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3904 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3905 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3906 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3907 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3908 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3909 | 1 \ |
| 3910 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3911 | -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] | 3912 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3913 | -c "X509 - Certificate verification failed" |
| 3914 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3915 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3916 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3917 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3918 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3919 | 0 \ |
| 3920 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3921 | -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] | 3922 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3923 | -C "X509 - Certificate verification failed" |
| 3924 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3925 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3926 | "$P_SRV" \ |
| 3927 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3928 | 0 \ |
| 3929 | -c "x509_verify_cert() returned" \ |
| 3930 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3931 | -c "! Certificate verification flags"\ |
| 3932 | -C "! mbedtls_ssl_handshake returned" \ |
| 3933 | -C "X509 - Certificate verification failed" \ |
| 3934 | -C "SSL - No CA Chain is set, but required to operate" |
| 3935 | |
| 3936 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3937 | "$P_SRV" \ |
| 3938 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3939 | 1 \ |
| 3940 | -c "x509_verify_cert() returned" \ |
| 3941 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3942 | -c "! Certificate verification flags"\ |
| 3943 | -c "! mbedtls_ssl_handshake returned" \ |
| 3944 | -c "SSL - No CA Chain is set, but required to operate" |
| 3945 | |
| 3946 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3947 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3948 | # the client informs the server about the supported curves - it does, though, in the |
| 3949 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3950 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3951 | # different means to have the server ignoring the client's supported curve list. |
| 3952 | |
| 3953 | requires_config_enabled MBEDTLS_ECP_C |
| 3954 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3955 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3956 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3957 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3958 | 1 \ |
| 3959 | -c "bad certificate (EC key curve)"\ |
| 3960 | -c "! Certificate verification flags"\ |
| 3961 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3962 | |
| 3963 | requires_config_enabled MBEDTLS_ECP_C |
| 3964 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3965 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3966 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3967 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3968 | 1 \ |
| 3969 | -c "bad certificate (EC key curve)"\ |
| 3970 | -c "! Certificate verification flags"\ |
| 3971 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3972 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3973 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3974 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3975 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3976 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3977 | 0 \ |
| 3978 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3979 | -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] | 3980 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3981 | -C "X509 - Certificate verification failed" |
| 3982 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3983 | run_test "Authentication: client SHA256, server required" \ |
| 3984 | "$P_SRV auth_mode=required" \ |
| 3985 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3986 | key_file=data_files/server6.key \ |
| 3987 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3988 | 0 \ |
| 3989 | -c "Supported Signature Algorithm found: 4," \ |
| 3990 | -c "Supported Signature Algorithm found: 5," |
| 3991 | |
| 3992 | run_test "Authentication: client SHA384, server required" \ |
| 3993 | "$P_SRV auth_mode=required" \ |
| 3994 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3995 | key_file=data_files/server6.key \ |
| 3996 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3997 | 0 \ |
| 3998 | -c "Supported Signature Algorithm found: 4," \ |
| 3999 | -c "Supported Signature Algorithm found: 5," |
| 4000 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4001 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4002 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4003 | "$P_CLI debug_level=3 crt_file=none \ |
| 4004 | key_file=data_files/server5.key" \ |
| 4005 | 1 \ |
| 4006 | -S "skip write certificate request" \ |
| 4007 | -C "skip parse certificate request" \ |
| 4008 | -c "got a certificate request" \ |
| 4009 | -c "= write certificate$" \ |
| 4010 | -C "skip write certificate$" \ |
| 4011 | -S "x509_verify_cert() returned" \ |
| 4012 | -s "client has no certificate" \ |
| 4013 | -s "! mbedtls_ssl_handshake returned" \ |
| 4014 | -c "! mbedtls_ssl_handshake returned" \ |
| 4015 | -s "No client certification received from the client, but required by the authentication mode" |
| 4016 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4017 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4018 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4019 | "$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] | 4020 | key_file=data_files/server5.key" \ |
| 4021 | 1 \ |
| 4022 | -S "skip write certificate request" \ |
| 4023 | -C "skip parse certificate request" \ |
| 4024 | -c "got a certificate request" \ |
| 4025 | -C "skip write certificate" \ |
| 4026 | -C "skip write certificate verify" \ |
| 4027 | -S "skip parse certificate verify" \ |
| 4028 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4029 | -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] | 4030 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4031 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4032 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4033 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4034 | # We don't check that the client receives the alert because it might |
| 4035 | # detect that its write end of the connection is closed and abort |
| 4036 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4037 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4038 | run_test "Authentication: client cert not trusted, server required" \ |
| 4039 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4040 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4041 | key_file=data_files/server5.key" \ |
| 4042 | 1 \ |
| 4043 | -S "skip write certificate request" \ |
| 4044 | -C "skip parse certificate request" \ |
| 4045 | -c "got a certificate request" \ |
| 4046 | -C "skip write certificate" \ |
| 4047 | -C "skip write certificate verify" \ |
| 4048 | -S "skip parse certificate verify" \ |
| 4049 | -s "x509_verify_cert() returned" \ |
| 4050 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4051 | -s "! mbedtls_ssl_handshake returned" \ |
| 4052 | -c "! mbedtls_ssl_handshake returned" \ |
| 4053 | -s "X509 - Certificate verification failed" |
| 4054 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4055 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4056 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4057 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4058 | key_file=data_files/server5.key" \ |
| 4059 | 0 \ |
| 4060 | -S "skip write certificate request" \ |
| 4061 | -C "skip parse certificate request" \ |
| 4062 | -c "got a certificate request" \ |
| 4063 | -C "skip write certificate" \ |
| 4064 | -C "skip write certificate verify" \ |
| 4065 | -S "skip parse certificate verify" \ |
| 4066 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4067 | -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] | 4068 | -S "! mbedtls_ssl_handshake returned" \ |
| 4069 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4070 | -S "X509 - Certificate verification failed" |
| 4071 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4072 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4073 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4074 | "$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] | 4075 | key_file=data_files/server5.key" \ |
| 4076 | 0 \ |
| 4077 | -s "skip write certificate request" \ |
| 4078 | -C "skip parse certificate request" \ |
| 4079 | -c "got no certificate request" \ |
| 4080 | -c "skip write certificate" \ |
| 4081 | -c "skip write certificate verify" \ |
| 4082 | -s "skip parse certificate verify" \ |
| 4083 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4084 | -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] | 4085 | -S "! mbedtls_ssl_handshake returned" \ |
| 4086 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4087 | -S "X509 - Certificate verification failed" |
| 4088 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4089 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4090 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4091 | "$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] | 4092 | 0 \ |
| 4093 | -S "skip write certificate request" \ |
| 4094 | -C "skip parse certificate request" \ |
| 4095 | -c "got a certificate request" \ |
| 4096 | -C "skip write certificate$" \ |
| 4097 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4098 | -c "skip write certificate verify" \ |
| 4099 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4100 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4101 | -S "! mbedtls_ssl_handshake returned" \ |
| 4102 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4103 | -S "X509 - Certificate verification failed" |
| 4104 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4105 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4106 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4107 | "$O_CLI" \ |
| 4108 | 0 \ |
| 4109 | -S "skip write certificate request" \ |
| 4110 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4111 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4112 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4113 | -S "X509 - Certificate verification failed" |
| 4114 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4115 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4116 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4117 | "$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] | 4118 | 0 \ |
| 4119 | -C "skip parse certificate request" \ |
| 4120 | -c "got a certificate request" \ |
| 4121 | -C "skip write certificate$" \ |
| 4122 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4123 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4124 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4125 | run_test "Authentication: client no cert, openssl server required" \ |
| 4126 | "$O_SRV -Verify 10" \ |
| 4127 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4128 | 1 \ |
| 4129 | -C "skip parse certificate request" \ |
| 4130 | -c "got a certificate request" \ |
| 4131 | -C "skip write certificate$" \ |
| 4132 | -c "skip write certificate verify" \ |
| 4133 | -c "! mbedtls_ssl_handshake returned" |
| 4134 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4135 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4136 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4137 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4138 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4139 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4140 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4141 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4142 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4143 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4144 | # 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] | 4145 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4146 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4147 | run_test "Authentication: server max_int chain, client default" \ |
| 4148 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4149 | key_file=data_files/dir-maxpath/09.key" \ |
| 4150 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4151 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4152 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4153 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4154 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4155 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4156 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4157 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4158 | key_file=data_files/dir-maxpath/10.key" \ |
| 4159 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4160 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4161 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4162 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4163 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4164 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4165 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4166 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4167 | key_file=data_files/dir-maxpath/10.key" \ |
| 4168 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4169 | auth_mode=optional" \ |
| 4170 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4171 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4172 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4173 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4174 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4175 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4176 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4177 | key_file=data_files/dir-maxpath/10.key" \ |
| 4178 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4179 | auth_mode=none" \ |
| 4180 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4181 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4182 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4183 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4184 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4185 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4186 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4187 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4188 | key_file=data_files/dir-maxpath/10.key" \ |
| 4189 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4190 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4191 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4192 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4193 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4194 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4195 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4196 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4197 | key_file=data_files/dir-maxpath/10.key" \ |
| 4198 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4199 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4200 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4201 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4202 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4203 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4204 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4205 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4206 | key_file=data_files/dir-maxpath/10.key" \ |
| 4207 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4208 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4209 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4210 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4211 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4212 | run_test "Authentication: client max_int chain, server required" \ |
| 4213 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4214 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4215 | key_file=data_files/dir-maxpath/09.key" \ |
| 4216 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4217 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4218 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4219 | # Tests for CA list in CertificateRequest messages |
| 4220 | |
| 4221 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4222 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4223 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4224 | key_file=data_files/server6.key" \ |
| 4225 | 0 \ |
| 4226 | -s "requested DN" |
| 4227 | |
| 4228 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4229 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4230 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4231 | key_file=data_files/server6.key" \ |
| 4232 | 0 \ |
| 4233 | -S "requested DN" |
| 4234 | |
| 4235 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4236 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4237 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4238 | key_file=data_files/server5.key" \ |
| 4239 | 1 \ |
| 4240 | -S "requested DN" \ |
| 4241 | -s "x509_verify_cert() returned" \ |
| 4242 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4243 | -s "! mbedtls_ssl_handshake returned" \ |
| 4244 | -c "! mbedtls_ssl_handshake returned" \ |
| 4245 | -s "X509 - Certificate verification failed" |
| 4246 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4247 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4248 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4249 | |
| 4250 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4251 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4252 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4253 | key_file=data_files/server5.key" \ |
| 4254 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4255 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4256 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4257 | -c "x509_verify_cert() returned" \ |
| 4258 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4259 | -c "! mbedtls_ssl_handshake returned" \ |
| 4260 | -c "X509 - Certificate verification failed" |
| 4261 | |
| 4262 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4263 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4264 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4265 | key_file=data_files/server5.key" \ |
| 4266 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4267 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4268 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4269 | -c "x509_verify_cert() returned" \ |
| 4270 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4271 | -C "! mbedtls_ssl_handshake returned" \ |
| 4272 | -C "X509 - Certificate verification failed" |
| 4273 | |
| 4274 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4275 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4276 | # the client informs the server about the supported curves - it does, though, in the |
| 4277 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4278 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4279 | # different means to have the server ignoring the client's supported curve list. |
| 4280 | |
| 4281 | requires_config_enabled MBEDTLS_ECP_C |
| 4282 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4283 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4284 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4285 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4286 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4287 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4288 | -c "use CA callback for X.509 CRT verification" \ |
| 4289 | -c "bad certificate (EC key curve)" \ |
| 4290 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4291 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4292 | |
| 4293 | requires_config_enabled MBEDTLS_ECP_C |
| 4294 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4295 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4296 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4297 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4298 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4299 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4300 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4301 | -c "bad certificate (EC key curve)"\ |
| 4302 | -c "! Certificate verification flags"\ |
| 4303 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4304 | |
| 4305 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4306 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4307 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4308 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4309 | key_file=data_files/server6.key \ |
| 4310 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4311 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4312 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4313 | -c "Supported Signature Algorithm found: 4," \ |
| 4314 | -c "Supported Signature Algorithm found: 5," |
| 4315 | |
| 4316 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4317 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4318 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4319 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4320 | key_file=data_files/server6.key \ |
| 4321 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4322 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4323 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4324 | -c "Supported Signature Algorithm found: 4," \ |
| 4325 | -c "Supported Signature Algorithm found: 5," |
| 4326 | |
| 4327 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4328 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4329 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4330 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4331 | key_file=data_files/server5.key" \ |
| 4332 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4333 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4334 | -S "skip write certificate request" \ |
| 4335 | -C "skip parse certificate request" \ |
| 4336 | -c "got a certificate request" \ |
| 4337 | -C "skip write certificate" \ |
| 4338 | -C "skip write certificate verify" \ |
| 4339 | -S "skip parse certificate verify" \ |
| 4340 | -s "x509_verify_cert() returned" \ |
| 4341 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4342 | -s "! mbedtls_ssl_handshake returned" \ |
| 4343 | -s "send alert level=2 message=48" \ |
| 4344 | -c "! mbedtls_ssl_handshake returned" \ |
| 4345 | -s "X509 - Certificate verification failed" |
| 4346 | # We don't check that the client receives the alert because it might |
| 4347 | # detect that its write end of the connection is closed and abort |
| 4348 | # before reading the alert message. |
| 4349 | |
| 4350 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4351 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4352 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4353 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4354 | key_file=data_files/server5.key" \ |
| 4355 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4356 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4357 | -S "skip write certificate request" \ |
| 4358 | -C "skip parse certificate request" \ |
| 4359 | -c "got a certificate request" \ |
| 4360 | -C "skip write certificate" \ |
| 4361 | -C "skip write certificate verify" \ |
| 4362 | -S "skip parse certificate verify" \ |
| 4363 | -s "x509_verify_cert() returned" \ |
| 4364 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4365 | -s "! mbedtls_ssl_handshake returned" \ |
| 4366 | -c "! mbedtls_ssl_handshake returned" \ |
| 4367 | -s "X509 - Certificate verification failed" |
| 4368 | |
| 4369 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4370 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4371 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4372 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4373 | key_file=data_files/server5.key" \ |
| 4374 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4375 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4376 | -S "skip write certificate request" \ |
| 4377 | -C "skip parse certificate request" \ |
| 4378 | -c "got a certificate request" \ |
| 4379 | -C "skip write certificate" \ |
| 4380 | -C "skip write certificate verify" \ |
| 4381 | -S "skip parse certificate verify" \ |
| 4382 | -s "x509_verify_cert() returned" \ |
| 4383 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4384 | -S "! mbedtls_ssl_handshake returned" \ |
| 4385 | -C "! mbedtls_ssl_handshake returned" \ |
| 4386 | -S "X509 - Certificate verification failed" |
| 4387 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4388 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4389 | requires_full_size_output_buffer |
| 4390 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4391 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4392 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4393 | key_file=data_files/dir-maxpath/09.key" \ |
| 4394 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4395 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4396 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4397 | -C "X509 - A fatal error occurred" |
| 4398 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4399 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4400 | requires_full_size_output_buffer |
| 4401 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4402 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4403 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4404 | key_file=data_files/dir-maxpath/10.key" \ |
| 4405 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4406 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4407 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4408 | -c "X509 - A fatal error occurred" |
| 4409 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4410 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4411 | requires_full_size_output_buffer |
| 4412 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4413 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4414 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4415 | key_file=data_files/dir-maxpath/10.key" \ |
| 4416 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4417 | debug_level=3 auth_mode=optional" \ |
| 4418 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4419 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4420 | -c "X509 - A fatal error occurred" |
| 4421 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4422 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4423 | requires_full_size_output_buffer |
| 4424 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4425 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4426 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4427 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4428 | key_file=data_files/dir-maxpath/10.key" \ |
| 4429 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4430 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4431 | -s "X509 - A fatal error occurred" |
| 4432 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4433 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4434 | requires_full_size_output_buffer |
| 4435 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4436 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4437 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4438 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4439 | key_file=data_files/dir-maxpath/10.key" \ |
| 4440 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4441 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4442 | -s "X509 - A fatal error occurred" |
| 4443 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4444 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4445 | requires_full_size_output_buffer |
| 4446 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4447 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4448 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4449 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4450 | key_file=data_files/dir-maxpath/09.key" \ |
| 4451 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4452 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4453 | -S "X509 - A fatal error occurred" |
| 4454 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4455 | # Tests for certificate selection based on SHA verson |
| 4456 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4457 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4458 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4459 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4460 | key_file=data_files/server5.key \ |
| 4461 | crt_file2=data_files/server5-sha1.crt \ |
| 4462 | key_file2=data_files/server5.key" \ |
| 4463 | "$P_CLI force_version=tls1_2" \ |
| 4464 | 0 \ |
| 4465 | -c "signed using.*ECDSA with SHA256" \ |
| 4466 | -C "signed using.*ECDSA with SHA1" |
| 4467 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4468 | # tests for SNI |
| 4469 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4470 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4471 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4472 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4473 | 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] | 4474 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4475 | 0 \ |
| 4476 | -S "parse ServerName extension" \ |
| 4477 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4478 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4479 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4480 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4481 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4482 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4483 | 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] | 4484 | 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] | 4485 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4486 | 0 \ |
| 4487 | -s "parse ServerName extension" \ |
| 4488 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4489 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4490 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4491 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4492 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4493 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4494 | 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] | 4495 | 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] | 4496 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4497 | 0 \ |
| 4498 | -s "parse ServerName extension" \ |
| 4499 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4500 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4501 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4502 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4503 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4504 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4505 | 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] | 4506 | 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] | 4507 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4508 | 1 \ |
| 4509 | -s "parse ServerName extension" \ |
| 4510 | -s "ssl_sni_wrapper() returned" \ |
| 4511 | -s "mbedtls_ssl_handshake returned" \ |
| 4512 | -c "mbedtls_ssl_handshake returned" \ |
| 4513 | -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] | 4514 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4515 | run_test "SNI: client auth no override: optional" \ |
| 4516 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4517 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4518 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4519 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4520 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4521 | -S "skip write certificate request" \ |
| 4522 | -C "skip parse certificate request" \ |
| 4523 | -c "got a certificate request" \ |
| 4524 | -C "skip write certificate" \ |
| 4525 | -C "skip write certificate verify" \ |
| 4526 | -S "skip parse certificate verify" |
| 4527 | |
| 4528 | run_test "SNI: client auth override: none -> optional" \ |
| 4529 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4530 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4531 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4532 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4533 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4534 | -S "skip write certificate request" \ |
| 4535 | -C "skip parse certificate request" \ |
| 4536 | -c "got a certificate request" \ |
| 4537 | -C "skip write certificate" \ |
| 4538 | -C "skip write certificate verify" \ |
| 4539 | -S "skip parse certificate verify" |
| 4540 | |
| 4541 | run_test "SNI: client auth override: optional -> none" \ |
| 4542 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4543 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4544 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4545 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4546 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4547 | -s "skip write certificate request" \ |
| 4548 | -C "skip parse certificate request" \ |
| 4549 | -c "got no certificate request" \ |
| 4550 | -c "skip write certificate" \ |
| 4551 | -c "skip write certificate verify" \ |
| 4552 | -s "skip parse certificate verify" |
| 4553 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4554 | run_test "SNI: CA no override" \ |
| 4555 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4556 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4557 | ca_file=data_files/test-ca.crt \ |
| 4558 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4559 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4560 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4561 | 1 \ |
| 4562 | -S "skip write certificate request" \ |
| 4563 | -C "skip parse certificate request" \ |
| 4564 | -c "got a certificate request" \ |
| 4565 | -C "skip write certificate" \ |
| 4566 | -C "skip write certificate verify" \ |
| 4567 | -S "skip parse certificate verify" \ |
| 4568 | -s "x509_verify_cert() returned" \ |
| 4569 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4570 | -S "The certificate has been revoked (is on a CRL)" |
| 4571 | |
| 4572 | run_test "SNI: CA override" \ |
| 4573 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4574 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4575 | ca_file=data_files/test-ca.crt \ |
| 4576 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4577 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4578 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4579 | 0 \ |
| 4580 | -S "skip write certificate request" \ |
| 4581 | -C "skip parse certificate request" \ |
| 4582 | -c "got a certificate request" \ |
| 4583 | -C "skip write certificate" \ |
| 4584 | -C "skip write certificate verify" \ |
| 4585 | -S "skip parse certificate verify" \ |
| 4586 | -S "x509_verify_cert() returned" \ |
| 4587 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4588 | -S "The certificate has been revoked (is on a CRL)" |
| 4589 | |
| 4590 | run_test "SNI: CA override with CRL" \ |
| 4591 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4592 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4593 | ca_file=data_files/test-ca.crt \ |
| 4594 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4595 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4596 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4597 | 1 \ |
| 4598 | -S "skip write certificate request" \ |
| 4599 | -C "skip parse certificate request" \ |
| 4600 | -c "got a certificate request" \ |
| 4601 | -C "skip write certificate" \ |
| 4602 | -C "skip write certificate verify" \ |
| 4603 | -S "skip parse certificate verify" \ |
| 4604 | -s "x509_verify_cert() returned" \ |
| 4605 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4606 | -s "The certificate has been revoked (is on a CRL)" |
| 4607 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4608 | # Tests for SNI and DTLS |
| 4609 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4610 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4611 | run_test "SNI: DTLS, no SNI callback" \ |
| 4612 | "$P_SRV debug_level=3 dtls=1 \ |
| 4613 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4614 | "$P_CLI server_name=localhost dtls=1" \ |
| 4615 | 0 \ |
| 4616 | -S "parse ServerName extension" \ |
| 4617 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4618 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4619 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4620 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4621 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4622 | "$P_SRV debug_level=3 dtls=1 \ |
| 4623 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4624 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4625 | "$P_CLI server_name=localhost dtls=1" \ |
| 4626 | 0 \ |
| 4627 | -s "parse ServerName extension" \ |
| 4628 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4629 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4630 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4631 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4632 | run_test "SNI: DTLS, matching cert 2" \ |
| 4633 | "$P_SRV debug_level=3 dtls=1 \ |
| 4634 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4635 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4636 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4637 | 0 \ |
| 4638 | -s "parse ServerName extension" \ |
| 4639 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4640 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4641 | |
| 4642 | run_test "SNI: DTLS, no matching cert" \ |
| 4643 | "$P_SRV debug_level=3 dtls=1 \ |
| 4644 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4645 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4646 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4647 | 1 \ |
| 4648 | -s "parse ServerName extension" \ |
| 4649 | -s "ssl_sni_wrapper() returned" \ |
| 4650 | -s "mbedtls_ssl_handshake returned" \ |
| 4651 | -c "mbedtls_ssl_handshake returned" \ |
| 4652 | -c "SSL - A fatal alert message was received from our peer" |
| 4653 | |
| 4654 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4655 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4656 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4657 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4658 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4659 | 0 \ |
| 4660 | -S "skip write certificate request" \ |
| 4661 | -C "skip parse certificate request" \ |
| 4662 | -c "got a certificate request" \ |
| 4663 | -C "skip write certificate" \ |
| 4664 | -C "skip write certificate verify" \ |
| 4665 | -S "skip parse certificate verify" |
| 4666 | |
| 4667 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4668 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4669 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4670 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4671 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4672 | 0 \ |
| 4673 | -S "skip write certificate request" \ |
| 4674 | -C "skip parse certificate request" \ |
| 4675 | -c "got a certificate request" \ |
| 4676 | -C "skip write certificate" \ |
| 4677 | -C "skip write certificate verify" \ |
| 4678 | -S "skip parse certificate verify" |
| 4679 | |
| 4680 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4681 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4682 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4683 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4684 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4685 | 0 \ |
| 4686 | -s "skip write certificate request" \ |
| 4687 | -C "skip parse certificate request" \ |
| 4688 | -c "got no certificate request" \ |
| 4689 | -c "skip write certificate" \ |
| 4690 | -c "skip write certificate verify" \ |
| 4691 | -s "skip parse certificate verify" |
| 4692 | |
| 4693 | run_test "SNI: DTLS, CA no override" \ |
| 4694 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4695 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4696 | ca_file=data_files/test-ca.crt \ |
| 4697 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4698 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4699 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4700 | 1 \ |
| 4701 | -S "skip write certificate request" \ |
| 4702 | -C "skip parse certificate request" \ |
| 4703 | -c "got a certificate request" \ |
| 4704 | -C "skip write certificate" \ |
| 4705 | -C "skip write certificate verify" \ |
| 4706 | -S "skip parse certificate verify" \ |
| 4707 | -s "x509_verify_cert() returned" \ |
| 4708 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4709 | -S "The certificate has been revoked (is on a CRL)" |
| 4710 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4711 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4712 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4713 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4714 | ca_file=data_files/test-ca.crt \ |
| 4715 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4716 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4717 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4718 | 0 \ |
| 4719 | -S "skip write certificate request" \ |
| 4720 | -C "skip parse certificate request" \ |
| 4721 | -c "got a certificate request" \ |
| 4722 | -C "skip write certificate" \ |
| 4723 | -C "skip write certificate verify" \ |
| 4724 | -S "skip parse certificate verify" \ |
| 4725 | -S "x509_verify_cert() returned" \ |
| 4726 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4727 | -S "The certificate has been revoked (is on a CRL)" |
| 4728 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4729 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4730 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4731 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4732 | ca_file=data_files/test-ca.crt \ |
| 4733 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4734 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4735 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4736 | 1 \ |
| 4737 | -S "skip write certificate request" \ |
| 4738 | -C "skip parse certificate request" \ |
| 4739 | -c "got a certificate request" \ |
| 4740 | -C "skip write certificate" \ |
| 4741 | -C "skip write certificate verify" \ |
| 4742 | -S "skip parse certificate verify" \ |
| 4743 | -s "x509_verify_cert() returned" \ |
| 4744 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4745 | -s "The certificate has been revoked (is on a CRL)" |
| 4746 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4747 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4748 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4749 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4750 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4751 | "$P_CLI nbio=2 tickets=0" \ |
| 4752 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4753 | -S "mbedtls_ssl_handshake returned" \ |
| 4754 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4755 | -c "Read from server: .* bytes read" |
| 4756 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4757 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4758 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4759 | "$P_CLI nbio=2 tickets=0" \ |
| 4760 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4761 | -S "mbedtls_ssl_handshake returned" \ |
| 4762 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4763 | -c "Read from server: .* bytes read" |
| 4764 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4765 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4766 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4767 | "$P_CLI nbio=2 tickets=1" \ |
| 4768 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4769 | -S "mbedtls_ssl_handshake returned" \ |
| 4770 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4771 | -c "Read from server: .* bytes read" |
| 4772 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4773 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4774 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4775 | "$P_CLI nbio=2 tickets=1" \ |
| 4776 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4777 | -S "mbedtls_ssl_handshake returned" \ |
| 4778 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4779 | -c "Read from server: .* bytes read" |
| 4780 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4781 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4782 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4783 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4784 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4785 | -S "mbedtls_ssl_handshake returned" \ |
| 4786 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4787 | -c "Read from server: .* bytes read" |
| 4788 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4789 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4790 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4791 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4792 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4793 | -S "mbedtls_ssl_handshake returned" \ |
| 4794 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4795 | -c "Read from server: .* bytes read" |
| 4796 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4797 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4798 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4799 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4800 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4801 | -S "mbedtls_ssl_handshake returned" \ |
| 4802 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4803 | -c "Read from server: .* bytes read" |
| 4804 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4805 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4806 | |
| 4807 | run_test "Event-driven I/O: basic handshake" \ |
| 4808 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4809 | "$P_CLI event=1 tickets=0" \ |
| 4810 | 0 \ |
| 4811 | -S "mbedtls_ssl_handshake returned" \ |
| 4812 | -C "mbedtls_ssl_handshake returned" \ |
| 4813 | -c "Read from server: .* bytes read" |
| 4814 | |
| 4815 | run_test "Event-driven I/O: client auth" \ |
| 4816 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4817 | "$P_CLI event=1 tickets=0" \ |
| 4818 | 0 \ |
| 4819 | -S "mbedtls_ssl_handshake returned" \ |
| 4820 | -C "mbedtls_ssl_handshake returned" \ |
| 4821 | -c "Read from server: .* bytes read" |
| 4822 | |
| 4823 | run_test "Event-driven I/O: ticket" \ |
| 4824 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4825 | "$P_CLI event=1 tickets=1" \ |
| 4826 | 0 \ |
| 4827 | -S "mbedtls_ssl_handshake returned" \ |
| 4828 | -C "mbedtls_ssl_handshake returned" \ |
| 4829 | -c "Read from server: .* bytes read" |
| 4830 | |
| 4831 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4832 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4833 | "$P_CLI event=1 tickets=1" \ |
| 4834 | 0 \ |
| 4835 | -S "mbedtls_ssl_handshake returned" \ |
| 4836 | -C "mbedtls_ssl_handshake returned" \ |
| 4837 | -c "Read from server: .* bytes read" |
| 4838 | |
| 4839 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4840 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4841 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4842 | 0 \ |
| 4843 | -S "mbedtls_ssl_handshake returned" \ |
| 4844 | -C "mbedtls_ssl_handshake returned" \ |
| 4845 | -c "Read from server: .* bytes read" |
| 4846 | |
| 4847 | run_test "Event-driven I/O: ticket + resume" \ |
| 4848 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4849 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4850 | 0 \ |
| 4851 | -S "mbedtls_ssl_handshake returned" \ |
| 4852 | -C "mbedtls_ssl_handshake returned" \ |
| 4853 | -c "Read from server: .* bytes read" |
| 4854 | |
| 4855 | run_test "Event-driven I/O: session-id resume" \ |
| 4856 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4857 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4858 | 0 \ |
| 4859 | -S "mbedtls_ssl_handshake returned" \ |
| 4860 | -C "mbedtls_ssl_handshake returned" \ |
| 4861 | -c "Read from server: .* bytes read" |
| 4862 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4863 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4864 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4865 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4866 | 0 \ |
| 4867 | -c "Read from server: .* bytes read" |
| 4868 | |
| 4869 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4870 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4871 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4872 | 0 \ |
| 4873 | -c "Read from server: .* bytes read" |
| 4874 | |
| 4875 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4876 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4877 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4878 | 0 \ |
| 4879 | -c "Read from server: .* bytes read" |
| 4880 | |
| 4881 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4882 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4883 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4884 | 0 \ |
| 4885 | -c "Read from server: .* bytes read" |
| 4886 | |
| 4887 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4888 | "$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] | 4889 | "$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] | 4890 | 0 \ |
| 4891 | -c "Read from server: .* bytes read" |
| 4892 | |
| 4893 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4894 | "$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] | 4895 | "$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] | 4896 | 0 \ |
| 4897 | -c "Read from server: .* bytes read" |
| 4898 | |
| 4899 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4900 | "$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] | 4901 | "$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] | 4902 | 0 \ |
| 4903 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4904 | |
| 4905 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4906 | # During session resumption, the client will send its ApplicationData record |
| 4907 | # within the same datagram as the Finished messages. In this situation, the |
| 4908 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4909 | # because the ApplicationData request has already been queued internally. |
| 4910 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4911 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4912 | "$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] | 4913 | "$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] | 4914 | 0 \ |
| 4915 | -c "Read from server: .* bytes read" |
| 4916 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4917 | # Tests for version negotiation |
| 4918 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4919 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4920 | "$P_SRV" \ |
| 4921 | "$P_CLI" \ |
| 4922 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4923 | -S "mbedtls_ssl_handshake returned" \ |
| 4924 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4925 | -s "Protocol is TLSv1.2" \ |
| 4926 | -c "Protocol is TLSv1.2" |
| 4927 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 4928 | run_test "Not supported version check: cli TLS 1.0" \ |
| 4929 | "$P_SRV" \ |
| 4930 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 4931 | 1 \ |
| 4932 | -s "Handshake protocol not within min/max boundaries" \ |
| 4933 | -c "Error in protocol version" \ |
| 4934 | -S "Protocol is TLSv1.0" \ |
| 4935 | -C "Handshake was completed" |
| 4936 | |
| 4937 | run_test "Not supported version check: cli TLS 1.1" \ |
| 4938 | "$P_SRV" \ |
| 4939 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 4940 | 1 \ |
| 4941 | -s "Handshake protocol not within min/max boundaries" \ |
| 4942 | -c "Error in protocol version" \ |
| 4943 | -S "Protocol is TLSv1.1" \ |
| 4944 | -C "Handshake was completed" |
| 4945 | |
| 4946 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 4947 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 4948 | "$P_CLI" \ |
| 4949 | 1 \ |
| 4950 | -s "Error in protocol version" \ |
| 4951 | -c "Handshake protocol not within min/max boundaries" \ |
| 4952 | -S "Version: TLS1.0" \ |
| 4953 | -C "Protocol is TLSv1.0" |
| 4954 | |
| 4955 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 4956 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 4957 | "$P_CLI" \ |
| 4958 | 1 \ |
| 4959 | -s "Error in protocol version" \ |
| 4960 | -c "Handshake protocol not within min/max boundaries" \ |
| 4961 | -S "Version: TLS1.1" \ |
| 4962 | -C "Protocol is TLSv1.1" |
| 4963 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4964 | # Tests for ALPN extension |
| 4965 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4966 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4967 | "$P_SRV debug_level=3" \ |
| 4968 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4969 | 0 \ |
| 4970 | -C "client hello, adding alpn extension" \ |
| 4971 | -S "found alpn extension" \ |
| 4972 | -C "got an alert message, type: \\[2:120]" \ |
| 4973 | -S "server hello, adding alpn extension" \ |
| 4974 | -C "found alpn extension " \ |
| 4975 | -C "Application Layer Protocol is" \ |
| 4976 | -S "Application Layer Protocol is" |
| 4977 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4978 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4979 | "$P_SRV debug_level=3" \ |
| 4980 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4981 | 0 \ |
| 4982 | -c "client hello, adding alpn extension" \ |
| 4983 | -s "found alpn extension" \ |
| 4984 | -C "got an alert message, type: \\[2:120]" \ |
| 4985 | -S "server hello, adding alpn extension" \ |
| 4986 | -C "found alpn extension " \ |
| 4987 | -c "Application Layer Protocol is (none)" \ |
| 4988 | -S "Application Layer Protocol is" |
| 4989 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4990 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4991 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4992 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4993 | 0 \ |
| 4994 | -C "client hello, adding alpn extension" \ |
| 4995 | -S "found alpn extension" \ |
| 4996 | -C "got an alert message, type: \\[2:120]" \ |
| 4997 | -S "server hello, adding alpn extension" \ |
| 4998 | -C "found alpn extension " \ |
| 4999 | -C "Application Layer Protocol is" \ |
| 5000 | -s "Application Layer Protocol is (none)" |
| 5001 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5002 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5003 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5004 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5005 | 0 \ |
| 5006 | -c "client hello, adding alpn extension" \ |
| 5007 | -s "found alpn extension" \ |
| 5008 | -C "got an alert message, type: \\[2:120]" \ |
| 5009 | -s "server hello, adding alpn extension" \ |
| 5010 | -c "found alpn extension" \ |
| 5011 | -c "Application Layer Protocol is abc" \ |
| 5012 | -s "Application Layer Protocol is abc" |
| 5013 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5014 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5015 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5016 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5017 | 0 \ |
| 5018 | -c "client hello, adding alpn extension" \ |
| 5019 | -s "found alpn extension" \ |
| 5020 | -C "got an alert message, type: \\[2:120]" \ |
| 5021 | -s "server hello, adding alpn extension" \ |
| 5022 | -c "found alpn extension" \ |
| 5023 | -c "Application Layer Protocol is abc" \ |
| 5024 | -s "Application Layer Protocol is abc" |
| 5025 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5026 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5027 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5028 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5029 | 0 \ |
| 5030 | -c "client hello, adding alpn extension" \ |
| 5031 | -s "found alpn extension" \ |
| 5032 | -C "got an alert message, type: \\[2:120]" \ |
| 5033 | -s "server hello, adding alpn extension" \ |
| 5034 | -c "found alpn extension" \ |
| 5035 | -c "Application Layer Protocol is 1234" \ |
| 5036 | -s "Application Layer Protocol is 1234" |
| 5037 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5038 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5039 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5040 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5041 | 1 \ |
| 5042 | -c "client hello, adding alpn extension" \ |
| 5043 | -s "found alpn extension" \ |
| 5044 | -c "got an alert message, type: \\[2:120]" \ |
| 5045 | -S "server hello, adding alpn extension" \ |
| 5046 | -C "found alpn extension" \ |
| 5047 | -C "Application Layer Protocol is 1234" \ |
| 5048 | -S "Application Layer Protocol is 1234" |
| 5049 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5050 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5051 | # Tests for keyUsage in leaf certificates, part 1: |
| 5052 | # server-side certificate/suite selection |
| 5053 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5054 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5055 | "$P_SRV key_file=data_files/server2.key \ |
| 5056 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5057 | "$P_CLI" \ |
| 5058 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5059 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5060 | |
| 5061 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5062 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5063 | "$P_SRV key_file=data_files/server2.key \ |
| 5064 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5065 | "$P_CLI" \ |
| 5066 | 0 \ |
| 5067 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5068 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5069 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5070 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5071 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5072 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5073 | 1 \ |
| 5074 | -C "Ciphersuite is " |
| 5075 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5076 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5077 | "$P_SRV key_file=data_files/server5.key \ |
| 5078 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5079 | "$P_CLI" \ |
| 5080 | 0 \ |
| 5081 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5082 | |
| 5083 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5084 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5085 | "$P_SRV key_file=data_files/server5.key \ |
| 5086 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5087 | "$P_CLI" \ |
| 5088 | 0 \ |
| 5089 | -c "Ciphersuite is TLS-ECDH-" |
| 5090 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5091 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5092 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5093 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5094 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5095 | 1 \ |
| 5096 | -C "Ciphersuite is " |
| 5097 | |
| 5098 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5099 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5100 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5101 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
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-ds_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-RSA-WITH-AES-128-CBC-SHA" \ |
| 5106 | 0 \ |
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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5111 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5112 | "$O_SRV -key data_files/server2.key \ |
| 5113 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5114 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5115 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5116 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5117 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5118 | -C "Processing of the Certificate handshake message failed" \ |
| 5119 | -c "Ciphersuite is TLS-" |
| 5120 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5121 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5122 | "$O_SRV -key data_files/server2.key \ |
| 5123 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5124 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5125 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5126 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5127 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5128 | -C "Processing of the Certificate handshake message failed" \ |
| 5129 | -c "Ciphersuite is TLS-" |
| 5130 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5131 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5132 | "$O_SRV -key data_files/server2.key \ |
| 5133 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5134 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5135 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5136 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5137 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5138 | -c "Processing of the Certificate handshake message failed" \ |
| 5139 | -C "Ciphersuite is TLS-" |
| 5140 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5141 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5142 | "$O_SRV -key data_files/server2.key \ |
| 5143 | -cert data_files/server2.ku-ke.crt" \ |
| 5144 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5145 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5146 | 0 \ |
| 5147 | -c "bad certificate (usage extensions)" \ |
| 5148 | -C "Processing of the Certificate handshake message failed" \ |
| 5149 | -c "Ciphersuite is TLS-" \ |
| 5150 | -c "! Usage does not match the keyUsage extension" |
| 5151 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5152 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5153 | "$O_SRV -key data_files/server2.key \ |
| 5154 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5155 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5156 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5157 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5158 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5159 | -C "Processing of the Certificate handshake message failed" \ |
| 5160 | -c "Ciphersuite is TLS-" |
| 5161 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5162 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5163 | "$O_SRV -key data_files/server2.key \ |
| 5164 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5165 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5166 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5167 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5168 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5169 | -c "Processing of the Certificate handshake message failed" \ |
| 5170 | -C "Ciphersuite is TLS-" |
| 5171 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5172 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5173 | "$O_SRV -key data_files/server2.key \ |
| 5174 | -cert data_files/server2.ku-ds.crt" \ |
| 5175 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5176 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5177 | 0 \ |
| 5178 | -c "bad certificate (usage extensions)" \ |
| 5179 | -C "Processing of the Certificate handshake message failed" \ |
| 5180 | -c "Ciphersuite is TLS-" \ |
| 5181 | -c "! Usage does not match the keyUsage extension" |
| 5182 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5183 | # Tests for keyUsage in leaf certificates, part 3: |
| 5184 | # server-side checking of client cert |
| 5185 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5186 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5187 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5188 | "$O_CLI -key data_files/server2.key \ |
| 5189 | -cert data_files/server2.ku-ds.crt" \ |
| 5190 | 0 \ |
| 5191 | -S "bad certificate (usage extensions)" \ |
| 5192 | -S "Processing of the Certificate handshake message failed" |
| 5193 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5194 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5195 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5196 | "$O_CLI -key data_files/server2.key \ |
| 5197 | -cert data_files/server2.ku-ke.crt" \ |
| 5198 | 0 \ |
| 5199 | -s "bad certificate (usage extensions)" \ |
| 5200 | -S "Processing of the Certificate handshake message failed" |
| 5201 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5202 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5203 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5204 | "$O_CLI -key data_files/server2.key \ |
| 5205 | -cert data_files/server2.ku-ke.crt" \ |
| 5206 | 1 \ |
| 5207 | -s "bad certificate (usage extensions)" \ |
| 5208 | -s "Processing of the Certificate handshake message failed" |
| 5209 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5210 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5211 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5212 | "$O_CLI -key data_files/server5.key \ |
| 5213 | -cert data_files/server5.ku-ds.crt" \ |
| 5214 | 0 \ |
| 5215 | -S "bad certificate (usage extensions)" \ |
| 5216 | -S "Processing of the Certificate handshake message failed" |
| 5217 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5218 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5219 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5220 | "$O_CLI -key data_files/server5.key \ |
| 5221 | -cert data_files/server5.ku-ka.crt" \ |
| 5222 | 0 \ |
| 5223 | -s "bad certificate (usage extensions)" \ |
| 5224 | -S "Processing of the Certificate handshake message failed" |
| 5225 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5226 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5227 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5228 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5229 | "$P_SRV key_file=data_files/server5.key \ |
| 5230 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5231 | "$P_CLI" \ |
| 5232 | 0 |
| 5233 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5234 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5235 | "$P_SRV key_file=data_files/server5.key \ |
| 5236 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5237 | "$P_CLI" \ |
| 5238 | 0 |
| 5239 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5240 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5241 | "$P_SRV key_file=data_files/server5.key \ |
| 5242 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5243 | "$P_CLI" \ |
| 5244 | 0 |
| 5245 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5246 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5247 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5248 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5249 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5250 | 1 |
| 5251 | |
| 5252 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5253 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5254 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5255 | "$O_SRV -key data_files/server5.key \ |
| 5256 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5257 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5258 | 0 \ |
| 5259 | -C "bad certificate (usage extensions)" \ |
| 5260 | -C "Processing of the Certificate handshake message failed" \ |
| 5261 | -c "Ciphersuite is TLS-" |
| 5262 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5263 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5264 | "$O_SRV -key data_files/server5.key \ |
| 5265 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5266 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5267 | 0 \ |
| 5268 | -C "bad certificate (usage extensions)" \ |
| 5269 | -C "Processing of the Certificate handshake message failed" \ |
| 5270 | -c "Ciphersuite is TLS-" |
| 5271 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5272 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5273 | "$O_SRV -key data_files/server5.key \ |
| 5274 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5275 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5276 | 0 \ |
| 5277 | -C "bad certificate (usage extensions)" \ |
| 5278 | -C "Processing of the Certificate handshake message failed" \ |
| 5279 | -c "Ciphersuite is TLS-" |
| 5280 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5281 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5282 | "$O_SRV -key data_files/server5.key \ |
| 5283 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5284 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5285 | 1 \ |
| 5286 | -c "bad certificate (usage extensions)" \ |
| 5287 | -c "Processing of the Certificate handshake message failed" \ |
| 5288 | -C "Ciphersuite is TLS-" |
| 5289 | |
| 5290 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5291 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5292 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5293 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5294 | "$O_CLI -key data_files/server5.key \ |
| 5295 | -cert data_files/server5.eku-cli.crt" \ |
| 5296 | 0 \ |
| 5297 | -S "bad certificate (usage extensions)" \ |
| 5298 | -S "Processing of the Certificate handshake message failed" |
| 5299 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5300 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5301 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5302 | "$O_CLI -key data_files/server5.key \ |
| 5303 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5304 | 0 \ |
| 5305 | -S "bad certificate (usage extensions)" \ |
| 5306 | -S "Processing of the Certificate handshake message failed" |
| 5307 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5308 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5309 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5310 | "$O_CLI -key data_files/server5.key \ |
| 5311 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5312 | 0 \ |
| 5313 | -S "bad certificate (usage extensions)" \ |
| 5314 | -S "Processing of the Certificate handshake message failed" |
| 5315 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5316 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5317 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5318 | "$O_CLI -key data_files/server5.key \ |
| 5319 | -cert data_files/server5.eku-cs.crt" \ |
| 5320 | 0 \ |
| 5321 | -s "bad certificate (usage extensions)" \ |
| 5322 | -S "Processing of the Certificate handshake message failed" |
| 5323 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5324 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5325 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5326 | "$O_CLI -key data_files/server5.key \ |
| 5327 | -cert data_files/server5.eku-cs.crt" \ |
| 5328 | 1 \ |
| 5329 | -s "bad certificate (usage extensions)" \ |
| 5330 | -s "Processing of the Certificate handshake message failed" |
| 5331 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5332 | # Tests for DHM parameters loading |
| 5333 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5334 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5335 | "$P_SRV" \ |
| 5336 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5337 | debug_level=3" \ |
| 5338 | 0 \ |
| 5339 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5340 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5341 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5342 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5343 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5344 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5345 | debug_level=3" \ |
| 5346 | 0 \ |
| 5347 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5348 | -c "value of 'DHM: G ' (2 bits)" |
| 5349 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5350 | # Tests for DHM client-side size checking |
| 5351 | |
| 5352 | run_test "DHM size: server default, client default, OK" \ |
| 5353 | "$P_SRV" \ |
| 5354 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5355 | debug_level=1" \ |
| 5356 | 0 \ |
| 5357 | -C "DHM prime too short:" |
| 5358 | |
| 5359 | run_test "DHM size: server default, client 2048, OK" \ |
| 5360 | "$P_SRV" \ |
| 5361 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5362 | debug_level=1 dhmlen=2048" \ |
| 5363 | 0 \ |
| 5364 | -C "DHM prime too short:" |
| 5365 | |
| 5366 | run_test "DHM size: server 1024, client default, OK" \ |
| 5367 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5368 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5369 | debug_level=1" \ |
| 5370 | 0 \ |
| 5371 | -C "DHM prime too short:" |
| 5372 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5373 | run_test "DHM size: server 999, client 999, OK" \ |
| 5374 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5375 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5376 | debug_level=1 dhmlen=999" \ |
| 5377 | 0 \ |
| 5378 | -C "DHM prime too short:" |
| 5379 | |
| 5380 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5381 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5382 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5383 | debug_level=1 dhmlen=1000" \ |
| 5384 | 0 \ |
| 5385 | -C "DHM prime too short:" |
| 5386 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5387 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5388 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5389 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5390 | debug_level=1" \ |
| 5391 | 1 \ |
| 5392 | -c "DHM prime too short:" |
| 5393 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5394 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5395 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5396 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5397 | debug_level=1 dhmlen=1001" \ |
| 5398 | 1 \ |
| 5399 | -c "DHM prime too short:" |
| 5400 | |
| 5401 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5402 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5403 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5404 | debug_level=1 dhmlen=1000" \ |
| 5405 | 1 \ |
| 5406 | -c "DHM prime too short:" |
| 5407 | |
| 5408 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5409 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5410 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5411 | debug_level=1 dhmlen=999" \ |
| 5412 | 1 \ |
| 5413 | -c "DHM prime too short:" |
| 5414 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5415 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5416 | "$P_SRV" \ |
| 5417 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5418 | debug_level=1 dhmlen=2049" \ |
| 5419 | 1 \ |
| 5420 | -c "DHM prime too short:" |
| 5421 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5422 | # Tests for PSK callback |
| 5423 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5424 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5425 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5426 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5427 | psk_identity=foo psk=abc123" \ |
| 5428 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5429 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5430 | -S "SSL - Unknown identity received" \ |
| 5431 | -S "SSL - Verification of the message MAC failed" |
| 5432 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5433 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5434 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5435 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5436 | "$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] | 5437 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5438 | 0 \ |
| 5439 | -c "skip PMS generation for opaque PSK"\ |
| 5440 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5441 | -C "session hash for extended master secret"\ |
| 5442 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5443 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5444 | -S "SSL - Unknown identity received" \ |
| 5445 | -S "SSL - Verification of the message MAC failed" |
| 5446 | |
| 5447 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5448 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5449 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5450 | "$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] | 5451 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5452 | 0 \ |
| 5453 | -c "skip PMS generation for opaque PSK"\ |
| 5454 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5455 | -C "session hash for extended master secret"\ |
| 5456 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5457 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5458 | -S "SSL - Unknown identity received" \ |
| 5459 | -S "SSL - Verification of the message MAC failed" |
| 5460 | |
| 5461 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5462 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5463 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5464 | "$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] | 5465 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5466 | 0 \ |
| 5467 | -c "skip PMS generation for opaque PSK"\ |
| 5468 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5469 | -c "session hash for extended master secret"\ |
| 5470 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5471 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5472 | -S "SSL - Unknown identity received" \ |
| 5473 | -S "SSL - Verification of the message MAC failed" |
| 5474 | |
| 5475 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5476 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5477 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5478 | "$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] | 5479 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5480 | 0 \ |
| 5481 | -c "skip PMS generation for opaque PSK"\ |
| 5482 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5483 | -c "session hash for extended master secret"\ |
| 5484 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5485 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5486 | -S "SSL - Unknown identity received" \ |
| 5487 | -S "SSL - Verification of the message MAC failed" |
| 5488 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5489 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5490 | 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] | 5491 | "$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] | 5492 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5493 | psk_identity=foo psk=abc123" \ |
| 5494 | 0 \ |
| 5495 | -C "skip PMS generation for opaque PSK"\ |
| 5496 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5497 | -C "session hash for extended master secret"\ |
| 5498 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5499 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5500 | -S "SSL - Unknown identity received" \ |
| 5501 | -S "SSL - Verification of the message MAC failed" |
| 5502 | |
| 5503 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5504 | 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] | 5505 | "$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] | 5506 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5507 | psk_identity=foo psk=abc123" \ |
| 5508 | 0 \ |
| 5509 | -C "skip PMS generation for opaque PSK"\ |
| 5510 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5511 | -C "session hash for extended master secret"\ |
| 5512 | -S "session hash for extended master secret"\ |
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, static opaque on server, no callback, EMS" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5519 | "$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] | 5520 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5521 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5522 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5523 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5524 | -c "session hash for extended master secret"\ |
| 5525 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5526 | -C "skip PMS generation for opaque PSK"\ |
| 5527 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5528 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5529 | -S "SSL - Unknown identity received" \ |
| 5530 | -S "SSL - Verification of the message MAC failed" |
| 5531 | |
| 5532 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5533 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5534 | "$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] | 5535 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5536 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5537 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5538 | 0 \ |
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"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5541 | -C "skip PMS generation for opaque PSK"\ |
| 5542 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5543 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5544 | -S "SSL - Unknown identity received" \ |
| 5545 | -S "SSL - Verification of the message MAC failed" |
| 5546 | |
| 5547 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5548 | 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] | 5549 | "$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] | 5550 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5551 | psk_identity=def psk=beef" \ |
| 5552 | 0 \ |
| 5553 | -C "skip PMS generation for opaque PSK"\ |
| 5554 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5555 | -C "session hash for extended master secret"\ |
| 5556 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5557 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5558 | -S "SSL - Unknown identity received" \ |
| 5559 | -S "SSL - Verification of the message MAC failed" |
| 5560 | |
| 5561 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5562 | 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] | 5563 | "$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] | 5564 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5565 | psk_identity=def psk=beef" \ |
| 5566 | 0 \ |
| 5567 | -C "skip PMS generation for opaque PSK"\ |
| 5568 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5569 | -C "session hash for extended master secret"\ |
| 5570 | -S "session hash for extended master secret"\ |
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, no static PSK on server, opaque PSK from callback, EMS" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5577 | "$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] | 5578 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5579 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5580 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5581 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5582 | -c "session hash for extended master secret"\ |
| 5583 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5584 | -C "skip PMS generation for opaque PSK"\ |
| 5585 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5586 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5587 | -S "SSL - Unknown identity received" \ |
| 5588 | -S "SSL - Verification of the message MAC failed" |
| 5589 | |
| 5590 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5591 | 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] | 5592 | "$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] | 5593 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5594 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5595 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5596 | 0 \ |
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"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5599 | -C "skip PMS generation for opaque PSK"\ |
| 5600 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5601 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5602 | -S "SSL - Unknown identity received" \ |
| 5603 | -S "SSL - Verification of the message MAC failed" |
| 5604 | |
| 5605 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5606 | 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] | 5607 | "$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] | 5608 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5609 | psk_identity=def psk=beef" \ |
| 5610 | 0 \ |
| 5611 | -C "skip PMS generation for opaque PSK"\ |
| 5612 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5613 | -C "session hash for extended master secret"\ |
| 5614 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5615 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5616 | -S "SSL - Unknown identity received" \ |
| 5617 | -S "SSL - Verification of the message MAC failed" |
| 5618 | |
| 5619 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5620 | 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] | 5621 | "$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] | 5622 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5623 | psk_identity=def psk=beef" \ |
| 5624 | 0 \ |
| 5625 | -C "skip PMS generation for opaque PSK"\ |
| 5626 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5627 | -C "session hash for extended master secret"\ |
| 5628 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5629 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5630 | -S "SSL - Unknown identity received" \ |
| 5631 | -S "SSL - Verification of the message MAC failed" |
| 5632 | |
| 5633 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5634 | 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] | 5635 | "$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] | 5636 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5637 | psk_identity=def psk=beef" \ |
| 5638 | 0 \ |
| 5639 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5640 | -C "session hash for extended master secret"\ |
| 5641 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5642 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5643 | -S "SSL - Unknown identity received" \ |
| 5644 | -S "SSL - Verification of the message MAC failed" |
| 5645 | |
| 5646 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5647 | 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] | 5648 | "$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] | 5649 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5650 | psk_identity=def psk=beef" \ |
| 5651 | 0 \ |
| 5652 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5653 | -C "session hash for extended master secret"\ |
| 5654 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5655 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5656 | -S "SSL - Unknown identity received" \ |
| 5657 | -S "SSL - Verification of the message MAC failed" |
| 5658 | |
| 5659 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5660 | 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] | 5661 | "$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] | 5662 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5663 | psk_identity=def psk=beef" \ |
| 5664 | 1 \ |
| 5665 | -s "SSL - Verification of the message MAC failed" |
| 5666 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5667 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5668 | "$P_SRV" \ |
| 5669 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5670 | psk_identity=foo psk=abc123" \ |
| 5671 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5672 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5673 | -S "SSL - Unknown identity received" \ |
| 5674 | -S "SSL - Verification of the message MAC failed" |
| 5675 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5676 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5677 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5678 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5679 | psk_identity=foo psk=abc123" \ |
| 5680 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5681 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5682 | -s "SSL - Unknown identity received" \ |
| 5683 | -S "SSL - Verification of the message MAC failed" |
| 5684 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5685 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5686 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5687 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5688 | psk_identity=abc psk=dead" \ |
| 5689 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5690 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5691 | -S "SSL - Unknown identity received" \ |
| 5692 | -S "SSL - Verification of the message MAC failed" |
| 5693 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5694 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5695 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5696 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5697 | psk_identity=def psk=beef" \ |
| 5698 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5699 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5700 | -S "SSL - Unknown identity received" \ |
| 5701 | -S "SSL - Verification of the message MAC failed" |
| 5702 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5703 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5704 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5705 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5706 | psk_identity=ghi psk=beef" \ |
| 5707 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5708 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5709 | -s "SSL - Unknown identity received" \ |
| 5710 | -S "SSL - Verification of the message MAC failed" |
| 5711 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5712 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5713 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5714 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5715 | psk_identity=abc psk=beef" \ |
| 5716 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5717 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5718 | -S "SSL - Unknown identity received" \ |
| 5719 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5720 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5721 | # Tests for EC J-PAKE |
| 5722 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5723 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5724 | run_test "ECJPAKE: client not configured" \ |
| 5725 | "$P_SRV debug_level=3" \ |
| 5726 | "$P_CLI debug_level=3" \ |
| 5727 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5728 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5729 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5730 | -S "found ecjpake kkpp extension" \ |
| 5731 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5732 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5733 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5734 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5735 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5736 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5737 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5738 | run_test "ECJPAKE: server not configured" \ |
| 5739 | "$P_SRV debug_level=3" \ |
| 5740 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5741 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5742 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5743 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5744 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5745 | -s "found ecjpake kkpp extension" \ |
| 5746 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5747 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5748 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5749 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5750 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5751 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5752 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5753 | run_test "ECJPAKE: working, TLS" \ |
| 5754 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5755 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5756 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5757 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5758 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5759 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5760 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5761 | -s "found ecjpake kkpp extension" \ |
| 5762 | -S "skip ecjpake kkpp extension" \ |
| 5763 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5764 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5765 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5766 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5767 | -S "SSL - Verification of the message MAC failed" |
| 5768 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5769 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5770 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5771 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5772 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5773 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5774 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5775 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5776 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5777 | -s "SSL - Verification of the message MAC failed" |
| 5778 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5779 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5780 | run_test "ECJPAKE: working, DTLS" \ |
| 5781 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5782 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5783 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5784 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5785 | -c "re-using cached ecjpake parameters" \ |
| 5786 | -S "SSL - Verification of the message MAC failed" |
| 5787 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5788 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5789 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5790 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5791 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5792 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5793 | 0 \ |
| 5794 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5795 | -S "SSL - Verification of the message MAC failed" |
| 5796 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5797 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5798 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5799 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5800 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5801 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5802 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5803 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5804 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5805 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5806 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5807 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5808 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5809 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5810 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5811 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5812 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5813 | 0 |
| 5814 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5815 | # Test for ClientHello without extensions |
| 5816 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5817 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5818 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5819 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5820 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5821 | 0 \ |
| 5822 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5823 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5824 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5825 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5826 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5827 | "$P_SRV" \ |
| 5828 | "$P_CLI request_size=100" \ |
| 5829 | 0 \ |
| 5830 | -s "Read from client: 100 bytes read$" |
| 5831 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5832 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5833 | "$P_SRV" \ |
| 5834 | "$P_CLI request_size=500" \ |
| 5835 | 0 \ |
| 5836 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5837 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5838 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5839 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5840 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5841 | "$P_SRV" \ |
| 5842 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5843 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5844 | 0 \ |
| 5845 | -s "Read from client: 1 bytes read" |
| 5846 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5847 | 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] | 5848 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5849 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5850 | 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] | 5851 | 0 \ |
| 5852 | -s "Read from client: 1 bytes read" |
| 5853 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5854 | 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] | 5855 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5856 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5857 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5858 | 0 \ |
| 5859 | -s "Read from client: 1 bytes read" |
| 5860 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5861 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5862 | "$P_SRV" \ |
| 5863 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5864 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5865 | 0 \ |
| 5866 | -s "Read from client: 1 bytes read" |
| 5867 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5868 | 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] | 5869 | "$P_SRV" \ |
| 5870 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5871 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5872 | 0 \ |
| 5873 | -s "Read from client: 1 bytes read" |
| 5874 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5875 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5876 | |
| 5877 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5878 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5879 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5880 | "$P_CLI dtls=1 request_size=1 \ |
| 5881 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5882 | 0 \ |
| 5883 | -s "Read from client: 1 bytes read" |
| 5884 | |
| 5885 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5886 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5887 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5888 | "$P_CLI dtls=1 request_size=1 \ |
| 5889 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5890 | 0 \ |
| 5891 | -s "Read from client: 1 bytes read" |
| 5892 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5893 | # Tests for small server packets |
| 5894 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5895 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5896 | "$P_SRV response_size=1" \ |
| 5897 | "$P_CLI force_version=tls1_2 \ |
| 5898 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5899 | 0 \ |
| 5900 | -c "Read from server: 1 bytes read" |
| 5901 | |
| 5902 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5903 | "$P_SRV response_size=1" \ |
| 5904 | "$P_CLI force_version=tls1_2 \ |
| 5905 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5906 | 0 \ |
| 5907 | -c "Read from server: 1 bytes read" |
| 5908 | |
| 5909 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5910 | "$P_SRV response_size=1" \ |
| 5911 | "$P_CLI force_version=tls1_2 \ |
| 5912 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5913 | 0 \ |
| 5914 | -c "Read from server: 1 bytes read" |
| 5915 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5916 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5917 | "$P_SRV response_size=1" \ |
| 5918 | "$P_CLI force_version=tls1_2 \ |
| 5919 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5920 | 0 \ |
| 5921 | -c "Read from server: 1 bytes read" |
| 5922 | |
| 5923 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5924 | "$P_SRV response_size=1" \ |
| 5925 | "$P_CLI force_version=tls1_2 \ |
| 5926 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5927 | 0 \ |
| 5928 | -c "Read from server: 1 bytes read" |
| 5929 | |
| 5930 | # Tests for small server packets in DTLS |
| 5931 | |
| 5932 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5933 | run_test "Small server packet DTLS 1.2" \ |
| 5934 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5935 | "$P_CLI dtls=1 \ |
| 5936 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5937 | 0 \ |
| 5938 | -c "Read from server: 1 bytes read" |
| 5939 | |
| 5940 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5941 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5942 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5943 | "$P_CLI dtls=1 \ |
| 5944 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5945 | 0 \ |
| 5946 | -c "Read from server: 1 bytes read" |
| 5947 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5948 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5949 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5950 | # How many fragments do we expect to write $1 bytes? |
| 5951 | fragments_for_write() { |
| 5952 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5953 | } |
| 5954 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5955 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5956 | "$P_SRV" \ |
| 5957 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5958 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5959 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5960 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5961 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5962 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5963 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5964 | "$P_SRV" \ |
| 5965 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5966 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5967 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5968 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5969 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5970 | 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] | 5971 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5972 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5973 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5974 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5975 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5976 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5977 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5978 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5979 | "$P_SRV" \ |
| 5980 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5981 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5982 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5983 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5984 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5985 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5986 | 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] | 5987 | "$P_SRV" \ |
| 5988 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5989 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5990 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5991 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5992 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5993 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 5994 | # 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] | 5995 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5996 | "$P_SRV response_size=16384" \ |
| 5997 | "$P_CLI force_version=tls1_2 \ |
| 5998 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5999 | 0 \ |
| 6000 | -c "Read from server: 16384 bytes read" |
| 6001 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6002 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6003 | "$P_SRV response_size=16384" \ |
| 6004 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6005 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6006 | 0 \ |
| 6007 | -s "16384 bytes written in 1 fragments" \ |
| 6008 | -c "Read from server: 16384 bytes read" |
| 6009 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6010 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6011 | "$P_SRV response_size=16384" \ |
| 6012 | "$P_CLI force_version=tls1_2 \ |
| 6013 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6014 | 0 \ |
| 6015 | -c "Read from server: 16384 bytes read" |
| 6016 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6017 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6018 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6019 | "$P_CLI force_version=tls1_2 \ |
| 6020 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6021 | 0 \ |
| 6022 | -s "16384 bytes written in 1 fragments" \ |
| 6023 | -c "Read from server: 16384 bytes read" |
| 6024 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6025 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6026 | "$P_SRV response_size=16384" \ |
| 6027 | "$P_CLI force_version=tls1_2 \ |
| 6028 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6029 | 0 \ |
| 6030 | -c "Read from server: 16384 bytes read" |
| 6031 | |
| 6032 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6033 | "$P_SRV response_size=16384" \ |
| 6034 | "$P_CLI force_version=tls1_2 \ |
| 6035 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6036 | 0 \ |
| 6037 | -c "Read from server: 16384 bytes read" |
| 6038 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6039 | # Tests for restartable ECC |
| 6040 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6041 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 6042 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6043 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6044 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6045 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6046 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6047 | "$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] | 6048 | 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] | 6049 | debug_level=1" \ |
| 6050 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6051 | -C "x509_verify_cert.*4b00" \ |
| 6052 | -C "mbedtls_pk_verify.*4b00" \ |
| 6053 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6054 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6055 | |
| 6056 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6057 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6058 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6059 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6060 | "$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] | 6061 | 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] | 6062 | debug_level=1 ec_max_ops=0" \ |
| 6063 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6064 | -C "x509_verify_cert.*4b00" \ |
| 6065 | -C "mbedtls_pk_verify.*4b00" \ |
| 6066 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6067 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6068 | |
| 6069 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6070 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6071 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6072 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6073 | "$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] | 6074 | 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] | 6075 | debug_level=1 ec_max_ops=65535" \ |
| 6076 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6077 | -C "x509_verify_cert.*4b00" \ |
| 6078 | -C "mbedtls_pk_verify.*4b00" \ |
| 6079 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6080 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6081 | |
| 6082 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6083 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6084 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6085 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6086 | "$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] | 6087 | 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] | 6088 | debug_level=1 ec_max_ops=1000" \ |
| 6089 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6090 | -c "x509_verify_cert.*4b00" \ |
| 6091 | -c "mbedtls_pk_verify.*4b00" \ |
| 6092 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6093 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6094 | |
| 6095 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6096 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6097 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6098 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6099 | crt_file=data_files/server5-badsign.crt \ |
| 6100 | key_file=data_files/server5.key" \ |
| 6101 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6102 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6103 | debug_level=1 ec_max_ops=1000" \ |
| 6104 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6105 | -c "x509_verify_cert.*4b00" \ |
| 6106 | -C "mbedtls_pk_verify.*4b00" \ |
| 6107 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6108 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6109 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6110 | -c "! mbedtls_ssl_handshake returned" \ |
| 6111 | -c "X509 - Certificate verification failed" |
| 6112 | |
| 6113 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6114 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6115 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6116 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6117 | crt_file=data_files/server5-badsign.crt \ |
| 6118 | key_file=data_files/server5.key" \ |
| 6119 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6120 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6121 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6122 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6123 | -c "x509_verify_cert.*4b00" \ |
| 6124 | -c "mbedtls_pk_verify.*4b00" \ |
| 6125 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6126 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6127 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6128 | -C "! mbedtls_ssl_handshake returned" \ |
| 6129 | -C "X509 - Certificate verification failed" |
| 6130 | |
| 6131 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6132 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6133 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6134 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6135 | crt_file=data_files/server5-badsign.crt \ |
| 6136 | key_file=data_files/server5.key" \ |
| 6137 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6138 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6139 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6140 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6141 | -C "x509_verify_cert.*4b00" \ |
| 6142 | -c "mbedtls_pk_verify.*4b00" \ |
| 6143 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6144 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6145 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6146 | -C "! mbedtls_ssl_handshake returned" \ |
| 6147 | -C "X509 - Certificate verification failed" |
| 6148 | |
| 6149 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6150 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6151 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6152 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6153 | "$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] | 6154 | 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] | 6155 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6156 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6157 | -c "x509_verify_cert.*4b00" \ |
| 6158 | -c "mbedtls_pk_verify.*4b00" \ |
| 6159 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6160 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6161 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6162 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6163 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6164 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6165 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6166 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6167 | debug_level=1 ec_max_ops=1000" \ |
| 6168 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6169 | -c "x509_verify_cert.*4b00" \ |
| 6170 | -c "mbedtls_pk_verify.*4b00" \ |
| 6171 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6172 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6173 | |
| 6174 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6175 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6176 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6177 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6178 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6179 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6180 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6181 | -C "x509_verify_cert.*4b00" \ |
| 6182 | -C "mbedtls_pk_verify.*4b00" \ |
| 6183 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6184 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6185 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6186 | # Tests of asynchronous private key support in SSL |
| 6187 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6188 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6189 | run_test "SSL async private: sign, delay=0" \ |
| 6190 | "$P_SRV \ |
| 6191 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6192 | "$P_CLI" \ |
| 6193 | 0 \ |
| 6194 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6195 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6196 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6197 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6198 | run_test "SSL async private: sign, delay=1" \ |
| 6199 | "$P_SRV \ |
| 6200 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6201 | "$P_CLI" \ |
| 6202 | 0 \ |
| 6203 | -s "Async sign callback: using key slot " \ |
| 6204 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6205 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6206 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6207 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6208 | run_test "SSL async private: sign, delay=2" \ |
| 6209 | "$P_SRV \ |
| 6210 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6211 | "$P_CLI" \ |
| 6212 | 0 \ |
| 6213 | -s "Async sign callback: using key slot " \ |
| 6214 | -U "Async sign callback: using key slot " \ |
| 6215 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6216 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6217 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6218 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6219 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6220 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6221 | run_test "SSL async private: sign, SNI" \ |
| 6222 | "$P_SRV debug_level=3 \ |
| 6223 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6224 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6225 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6226 | "$P_CLI server_name=polarssl.example" \ |
| 6227 | 0 \ |
| 6228 | -s "Async sign callback: using key slot " \ |
| 6229 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6230 | -s "parse ServerName extension" \ |
| 6231 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6232 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6233 | |
| 6234 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6235 | run_test "SSL async private: decrypt, delay=0" \ |
| 6236 | "$P_SRV \ |
| 6237 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6238 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6239 | 0 \ |
| 6240 | -s "Async decrypt callback: using key slot " \ |
| 6241 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6242 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6243 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6244 | run_test "SSL async private: decrypt, delay=1" \ |
| 6245 | "$P_SRV \ |
| 6246 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6247 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6248 | 0 \ |
| 6249 | -s "Async decrypt callback: using key slot " \ |
| 6250 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6251 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6252 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6253 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6254 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6255 | "$P_SRV psk=abc123 \ |
| 6256 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6257 | "$P_CLI psk=abc123 \ |
| 6258 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6259 | 0 \ |
| 6260 | -s "Async decrypt callback: using key slot " \ |
| 6261 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6262 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6263 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6264 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6265 | "$P_SRV psk=abc123 \ |
| 6266 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6267 | "$P_CLI psk=abc123 \ |
| 6268 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6269 | 0 \ |
| 6270 | -s "Async decrypt callback: using key slot " \ |
| 6271 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6272 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6273 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6274 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6275 | run_test "SSL async private: sign callback not present" \ |
| 6276 | "$P_SRV \ |
| 6277 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6278 | "$P_CLI; [ \$? -eq 1 ] && |
| 6279 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6280 | 0 \ |
| 6281 | -S "Async sign callback" \ |
| 6282 | -s "! mbedtls_ssl_handshake returned" \ |
| 6283 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6284 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6285 | -s "Successful connection" |
| 6286 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6287 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6288 | run_test "SSL async private: decrypt callback not present" \ |
| 6289 | "$P_SRV debug_level=1 \ |
| 6290 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6291 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6292 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6293 | 0 \ |
| 6294 | -S "Async decrypt callback" \ |
| 6295 | -s "! mbedtls_ssl_handshake returned" \ |
| 6296 | -s "got no RSA private key" \ |
| 6297 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6298 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6299 | |
| 6300 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6301 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6302 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6303 | "$P_SRV \ |
| 6304 | async_operations=s async_private_delay1=1 \ |
| 6305 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6306 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6307 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6308 | 0 \ |
| 6309 | -s "Async sign callback: using key slot 0," \ |
| 6310 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6311 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6312 | |
| 6313 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6314 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6315 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6316 | "$P_SRV \ |
| 6317 | async_operations=s async_private_delay2=1 \ |
| 6318 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6319 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6320 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6321 | 0 \ |
| 6322 | -s "Async sign callback: using key slot 0," \ |
| 6323 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6324 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6325 | |
| 6326 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6327 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6328 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6329 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6330 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6331 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6332 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6333 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6334 | 0 \ |
| 6335 | -s "Async sign callback: using key slot 1," \ |
| 6336 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6337 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6338 | |
| 6339 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6340 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6341 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6342 | "$P_SRV \ |
| 6343 | async_operations=s async_private_delay1=1 \ |
| 6344 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6345 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6346 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6347 | 0 \ |
| 6348 | -s "Async sign callback: no key matches this certificate." |
| 6349 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6350 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6351 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6352 | "$P_SRV \ |
| 6353 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6354 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6355 | "$P_CLI" \ |
| 6356 | 1 \ |
| 6357 | -s "Async sign callback: injected error" \ |
| 6358 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6359 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6360 | -s "! mbedtls_ssl_handshake returned" |
| 6361 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6362 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6363 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6364 | "$P_SRV \ |
| 6365 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6366 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6367 | "$P_CLI" \ |
| 6368 | 1 \ |
| 6369 | -s "Async sign callback: using key slot " \ |
| 6370 | -S "Async resume" \ |
| 6371 | -s "Async cancel" |
| 6372 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6373 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6374 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6375 | "$P_SRV \ |
| 6376 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6377 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6378 | "$P_CLI" \ |
| 6379 | 1 \ |
| 6380 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6381 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6382 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6383 | -s "! mbedtls_ssl_handshake returned" |
| 6384 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6385 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6386 | run_test "SSL async private: decrypt, error in start" \ |
| 6387 | "$P_SRV \ |
| 6388 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6389 | async_private_error=1" \ |
| 6390 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6391 | 1 \ |
| 6392 | -s "Async decrypt callback: injected error" \ |
| 6393 | -S "Async resume" \ |
| 6394 | -S "Async cancel" \ |
| 6395 | -s "! mbedtls_ssl_handshake returned" |
| 6396 | |
| 6397 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6398 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6399 | "$P_SRV \ |
| 6400 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6401 | async_private_error=2" \ |
| 6402 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6403 | 1 \ |
| 6404 | -s "Async decrypt callback: using key slot " \ |
| 6405 | -S "Async resume" \ |
| 6406 | -s "Async cancel" |
| 6407 | |
| 6408 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6409 | run_test "SSL async private: decrypt, error in resume" \ |
| 6410 | "$P_SRV \ |
| 6411 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6412 | async_private_error=3" \ |
| 6413 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6414 | 1 \ |
| 6415 | -s "Async decrypt callback: using key slot " \ |
| 6416 | -s "Async resume callback: decrypt done but injected error" \ |
| 6417 | -S "Async cancel" \ |
| 6418 | -s "! mbedtls_ssl_handshake returned" |
| 6419 | |
| 6420 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6421 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6422 | "$P_SRV \ |
| 6423 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6424 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6425 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6426 | 0 \ |
| 6427 | -s "Async cancel" \ |
| 6428 | -s "! mbedtls_ssl_handshake returned" \ |
| 6429 | -s "Async resume" \ |
| 6430 | -s "Successful connection" |
| 6431 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6432 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6433 | run_test "SSL async private: error in resume then operate correctly" \ |
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_delay2=1 \ |
| 6436 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6437 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6438 | 0 \ |
| 6439 | -s "! mbedtls_ssl_handshake returned" \ |
| 6440 | -s "Async resume" \ |
| 6441 | -s "Successful connection" |
| 6442 | |
| 6443 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6444 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6445 | 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] | 6446 | "$P_SRV \ |
| 6447 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6448 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6449 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6450 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6451 | [ \$? -eq 1 ] && |
| 6452 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6453 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6454 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6455 | -S "Async resume" \ |
| 6456 | -s "Async cancel" \ |
| 6457 | -s "! mbedtls_ssl_handshake returned" \ |
| 6458 | -s "Async sign callback: no key matches this certificate." \ |
| 6459 | -s "Successful connection" |
| 6460 | |
| 6461 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6462 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6463 | 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] | 6464 | "$P_SRV \ |
| 6465 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6466 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6467 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6468 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6469 | [ \$? -eq 1 ] && |
| 6470 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6471 | 0 \ |
| 6472 | -s "Async resume" \ |
| 6473 | -s "! mbedtls_ssl_handshake returned" \ |
| 6474 | -s "Async sign callback: no key matches this certificate." \ |
| 6475 | -s "Successful connection" |
| 6476 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6477 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6478 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6479 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6480 | "$P_SRV \ |
| 6481 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6482 | exchanges=2 renegotiation=1" \ |
| 6483 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6484 | 0 \ |
| 6485 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6486 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6487 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6488 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6489 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6490 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6491 | "$P_SRV \ |
| 6492 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6493 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6494 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6495 | 0 \ |
| 6496 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6497 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6498 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6499 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6500 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6501 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6502 | "$P_SRV \ |
| 6503 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6504 | exchanges=2 renegotiation=1" \ |
| 6505 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6506 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6507 | 0 \ |
| 6508 | -s "Async decrypt callback: using key slot " \ |
| 6509 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6510 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6511 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6512 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6513 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6514 | "$P_SRV \ |
| 6515 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6516 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6517 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6518 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6519 | 0 \ |
| 6520 | -s "Async decrypt callback: using key slot " \ |
| 6521 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6522 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6523 | # Tests for ECC extensions (rfc 4492) |
| 6524 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6525 | requires_config_enabled MBEDTLS_AES_C |
| 6526 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6527 | requires_config_enabled MBEDTLS_SHA256_C |
| 6528 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6529 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6530 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6531 | "$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] | 6532 | 0 \ |
| 6533 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6534 | -C "client hello, adding supported_point_formats extension" \ |
| 6535 | -S "found supported elliptic curves extension" \ |
| 6536 | -S "found supported point formats extension" |
| 6537 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6538 | requires_config_enabled MBEDTLS_AES_C |
| 6539 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6540 | requires_config_enabled MBEDTLS_SHA256_C |
| 6541 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6542 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6543 | "$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] | 6544 | "$P_CLI debug_level=3" \ |
| 6545 | 0 \ |
| 6546 | -C "found supported_point_formats extension" \ |
| 6547 | -S "server hello, supported_point_formats extension" |
| 6548 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6549 | requires_config_enabled MBEDTLS_AES_C |
| 6550 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6551 | requires_config_enabled MBEDTLS_SHA256_C |
| 6552 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6553 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6554 | "$P_SRV debug_level=3" \ |
| 6555 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6556 | 0 \ |
| 6557 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6558 | -c "client hello, adding supported_point_formats extension" \ |
| 6559 | -s "found supported elliptic curves extension" \ |
| 6560 | -s "found supported point formats extension" |
| 6561 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6562 | requires_config_enabled MBEDTLS_AES_C |
| 6563 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6564 | requires_config_enabled MBEDTLS_SHA256_C |
| 6565 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6566 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6567 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6568 | "$P_CLI debug_level=3" \ |
| 6569 | 0 \ |
| 6570 | -c "found supported_point_formats extension" \ |
| 6571 | -s "server hello, supported_point_formats extension" |
| 6572 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6573 | # Tests for DTLS HelloVerifyRequest |
| 6574 | |
| 6575 | run_test "DTLS cookie: enabled" \ |
| 6576 | "$P_SRV dtls=1 debug_level=2" \ |
| 6577 | "$P_CLI dtls=1 debug_level=2" \ |
| 6578 | 0 \ |
| 6579 | -s "cookie verification failed" \ |
| 6580 | -s "cookie verification passed" \ |
| 6581 | -S "cookie verification skipped" \ |
| 6582 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6583 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6584 | -S "SSL - The requested feature is not available" |
| 6585 | |
| 6586 | run_test "DTLS cookie: disabled" \ |
| 6587 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6588 | "$P_CLI dtls=1 debug_level=2" \ |
| 6589 | 0 \ |
| 6590 | -S "cookie verification failed" \ |
| 6591 | -S "cookie verification passed" \ |
| 6592 | -s "cookie verification skipped" \ |
| 6593 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6594 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6595 | -S "SSL - The requested feature is not available" |
| 6596 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6597 | run_test "DTLS cookie: default (failing)" \ |
| 6598 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6599 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6600 | 1 \ |
| 6601 | -s "cookie verification failed" \ |
| 6602 | -S "cookie verification passed" \ |
| 6603 | -S "cookie verification skipped" \ |
| 6604 | -C "received hello verify request" \ |
| 6605 | -S "hello verification requested" \ |
| 6606 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6607 | |
| 6608 | requires_ipv6 |
| 6609 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6610 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6611 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6612 | 0 \ |
| 6613 | -s "cookie verification failed" \ |
| 6614 | -s "cookie verification passed" \ |
| 6615 | -S "cookie verification skipped" \ |
| 6616 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6617 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6618 | -S "SSL - The requested feature is not available" |
| 6619 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6620 | run_test "DTLS cookie: enabled, nbio" \ |
| 6621 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6622 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6623 | 0 \ |
| 6624 | -s "cookie verification failed" \ |
| 6625 | -s "cookie verification passed" \ |
| 6626 | -S "cookie verification skipped" \ |
| 6627 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6628 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6629 | -S "SSL - The requested feature is not available" |
| 6630 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6631 | # Tests for client reconnecting from the same port with DTLS |
| 6632 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6633 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6634 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6635 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6636 | "$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] | 6637 | 0 \ |
| 6638 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6639 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6640 | -S "Client initiated reconnection from same port" |
| 6641 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6642 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6643 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6644 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6645 | "$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] | 6646 | 0 \ |
| 6647 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6648 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6649 | -s "Client initiated reconnection from same port" |
| 6650 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6651 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6652 | 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] | 6653 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6654 | "$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] | 6655 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6656 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6657 | -s "Client initiated reconnection from same port" |
| 6658 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6659 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6660 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6661 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6662 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6663 | 0 \ |
| 6664 | -S "The operation timed out" \ |
| 6665 | -s "Client initiated reconnection from same port" |
| 6666 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6667 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6668 | "$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] | 6669 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6670 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6671 | -s "The operation timed out" \ |
| 6672 | -S "Client initiated reconnection from same port" |
| 6673 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6674 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6675 | -p "$P_PXY inject_clihlo=1" \ |
| 6676 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6677 | "$P_CLI dtls=1 exchanges=2" \ |
| 6678 | 0 \ |
| 6679 | -s "possible client reconnect from the same port" \ |
| 6680 | -S "Client initiated reconnection from same port" |
| 6681 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6682 | # Tests for various cases of client authentication with DTLS |
| 6683 | # (focused on handshake flows and message parsing) |
| 6684 | |
| 6685 | run_test "DTLS client auth: required" \ |
| 6686 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6687 | "$P_CLI dtls=1" \ |
| 6688 | 0 \ |
| 6689 | -s "Verifying peer X.509 certificate... ok" |
| 6690 | |
| 6691 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6692 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6693 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6694 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6695 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6696 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6697 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6698 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6699 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6700 | 0 \ |
| 6701 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6702 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6703 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6704 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6705 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6706 | "$P_CLI dtls=1 psk=abc124" \ |
| 6707 | 1 \ |
| 6708 | -s "SSL - Verification of the message MAC failed" \ |
| 6709 | -c "SSL - A fatal alert message was received from our peer" |
| 6710 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6711 | # Tests for receiving fragmented handshake messages with DTLS |
| 6712 | |
| 6713 | requires_gnutls |
| 6714 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6715 | "$G_SRV -u --mtu 2048 -a" \ |
| 6716 | "$P_CLI dtls=1 debug_level=2" \ |
| 6717 | 0 \ |
| 6718 | -C "found fragmented DTLS handshake message" \ |
| 6719 | -C "error" |
| 6720 | |
| 6721 | requires_gnutls |
| 6722 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6723 | "$G_SRV -u --mtu 512" \ |
| 6724 | "$P_CLI dtls=1 debug_level=2" \ |
| 6725 | 0 \ |
| 6726 | -c "found fragmented DTLS handshake message" \ |
| 6727 | -C "error" |
| 6728 | |
| 6729 | requires_gnutls |
| 6730 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6731 | "$G_SRV -u --mtu 128" \ |
| 6732 | "$P_CLI dtls=1 debug_level=2" \ |
| 6733 | 0 \ |
| 6734 | -c "found fragmented DTLS handshake message" \ |
| 6735 | -C "error" |
| 6736 | |
| 6737 | requires_gnutls |
| 6738 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6739 | "$G_SRV -u --mtu 128" \ |
| 6740 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6741 | 0 \ |
| 6742 | -c "found fragmented DTLS handshake message" \ |
| 6743 | -C "error" |
| 6744 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6745 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6746 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6747 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6748 | "$G_SRV -u --mtu 256" \ |
| 6749 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6750 | 0 \ |
| 6751 | -c "found fragmented DTLS handshake message" \ |
| 6752 | -c "client hello, adding renegotiation extension" \ |
| 6753 | -c "found renegotiation extension" \ |
| 6754 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6755 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6756 | -C "error" \ |
| 6757 | -s "Extra-header:" |
| 6758 | |
| 6759 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6760 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6761 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6762 | "$G_SRV -u --mtu 256" \ |
| 6763 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6764 | 0 \ |
| 6765 | -c "found fragmented DTLS handshake message" \ |
| 6766 | -c "client hello, adding renegotiation extension" \ |
| 6767 | -c "found renegotiation extension" \ |
| 6768 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6769 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6770 | -C "error" \ |
| 6771 | -s "Extra-header:" |
| 6772 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6773 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6774 | "$O_SRV -dtls -mtu 2048" \ |
| 6775 | "$P_CLI dtls=1 debug_level=2" \ |
| 6776 | 0 \ |
| 6777 | -C "found fragmented DTLS handshake message" \ |
| 6778 | -C "error" |
| 6779 | |
| 6780 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6781 | "$O_SRV -dtls -mtu 768" \ |
| 6782 | "$P_CLI dtls=1 debug_level=2" \ |
| 6783 | 0 \ |
| 6784 | -c "found fragmented DTLS handshake message" \ |
| 6785 | -C "error" |
| 6786 | |
| 6787 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6788 | "$O_SRV -dtls -mtu 256" \ |
| 6789 | "$P_CLI dtls=1 debug_level=2" \ |
| 6790 | 0 \ |
| 6791 | -c "found fragmented DTLS handshake message" \ |
| 6792 | -C "error" |
| 6793 | |
| 6794 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6795 | "$O_SRV -dtls -mtu 256" \ |
| 6796 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6797 | 0 \ |
| 6798 | -c "found fragmented DTLS handshake message" \ |
| 6799 | -C "error" |
| 6800 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6801 | # Tests for sending fragmented handshake messages with DTLS |
| 6802 | # |
| 6803 | # Use client auth when we need the client to send large messages, |
| 6804 | # and use large cert chains on both sides too (the long chains we have all use |
| 6805 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6806 | # Sizes reached (UDP payload): |
| 6807 | # - 2037B for server certificate |
| 6808 | # - 1542B for client certificate |
| 6809 | # - 1013B for newsessionticket |
| 6810 | # - all others below 512B |
| 6811 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6812 | |
| 6813 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6814 | requires_config_enabled MBEDTLS_RSA_C |
| 6815 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6816 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6817 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6818 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6819 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6820 | crt_file=data_files/server7_int-ca.crt \ |
| 6821 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6822 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6823 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6824 | "$P_CLI dtls=1 debug_level=2 \ |
| 6825 | crt_file=data_files/server8_int-ca2.crt \ |
| 6826 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6827 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6828 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6829 | 0 \ |
| 6830 | -S "found fragmented DTLS handshake message" \ |
| 6831 | -C "found fragmented DTLS handshake message" \ |
| 6832 | -C "error" |
| 6833 | |
| 6834 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6835 | requires_config_enabled MBEDTLS_RSA_C |
| 6836 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6837 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6838 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6839 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6840 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6841 | crt_file=data_files/server7_int-ca.crt \ |
| 6842 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6843 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6844 | max_frag_len=1024" \ |
| 6845 | "$P_CLI dtls=1 debug_level=2 \ |
| 6846 | crt_file=data_files/server8_int-ca2.crt \ |
| 6847 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6848 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6849 | max_frag_len=2048" \ |
| 6850 | 0 \ |
| 6851 | -S "found fragmented DTLS handshake message" \ |
| 6852 | -c "found fragmented DTLS handshake message" \ |
| 6853 | -C "error" |
| 6854 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6855 | # With the MFL extension, the server has no way of forcing |
| 6856 | # the client to not exceed a certain MTU; hence, the following |
| 6857 | # test can't be replicated with an MTU proxy such as the one |
| 6858 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6859 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6860 | requires_config_enabled MBEDTLS_RSA_C |
| 6861 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6862 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6863 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6864 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6865 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6866 | crt_file=data_files/server7_int-ca.crt \ |
| 6867 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6868 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6869 | max_frag_len=512" \ |
| 6870 | "$P_CLI dtls=1 debug_level=2 \ |
| 6871 | crt_file=data_files/server8_int-ca2.crt \ |
| 6872 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6873 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6874 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6875 | 0 \ |
| 6876 | -S "found fragmented DTLS handshake message" \ |
| 6877 | -c "found fragmented DTLS handshake message" \ |
| 6878 | -C "error" |
| 6879 | |
| 6880 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6881 | requires_config_enabled MBEDTLS_RSA_C |
| 6882 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6883 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6884 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6885 | 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] | 6886 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6887 | crt_file=data_files/server7_int-ca.crt \ |
| 6888 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6889 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6890 | max_frag_len=2048" \ |
| 6891 | "$P_CLI dtls=1 debug_level=2 \ |
| 6892 | crt_file=data_files/server8_int-ca2.crt \ |
| 6893 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6894 | hs_timeout=2500-60000 \ |
| 6895 | max_frag_len=1024" \ |
| 6896 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6897 | -S "found fragmented DTLS handshake message" \ |
| 6898 | -c "found fragmented DTLS handshake message" \ |
| 6899 | -C "error" |
| 6900 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6901 | # While not required by the standard defining the MFL extension |
| 6902 | # (according to which it only applies to records, not to datagrams), |
| 6903 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6904 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6905 | # to the peer. |
| 6906 | # The next test checks that no datagrams significantly larger than the |
| 6907 | # negotiated MFL are sent. |
| 6908 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6909 | requires_config_enabled MBEDTLS_RSA_C |
| 6910 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6911 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6912 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6913 | 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] | 6914 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6915 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6916 | crt_file=data_files/server7_int-ca.crt \ |
| 6917 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6918 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6919 | max_frag_len=2048" \ |
| 6920 | "$P_CLI dtls=1 debug_level=2 \ |
| 6921 | crt_file=data_files/server8_int-ca2.crt \ |
| 6922 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6923 | hs_timeout=2500-60000 \ |
| 6924 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6925 | 0 \ |
| 6926 | -S "found fragmented DTLS handshake message" \ |
| 6927 | -c "found fragmented DTLS handshake message" \ |
| 6928 | -C "error" |
| 6929 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6930 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6931 | requires_config_enabled MBEDTLS_RSA_C |
| 6932 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6933 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6934 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6935 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6936 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6937 | crt_file=data_files/server7_int-ca.crt \ |
| 6938 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6939 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6940 | max_frag_len=2048" \ |
| 6941 | "$P_CLI dtls=1 debug_level=2 \ |
| 6942 | crt_file=data_files/server8_int-ca2.crt \ |
| 6943 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6944 | hs_timeout=2500-60000 \ |
| 6945 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6946 | 0 \ |
| 6947 | -s "found fragmented DTLS handshake message" \ |
| 6948 | -c "found fragmented DTLS handshake message" \ |
| 6949 | -C "error" |
| 6950 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6951 | # While not required by the standard defining the MFL extension |
| 6952 | # (according to which it only applies to records, not to datagrams), |
| 6953 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6954 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6955 | # to the peer. |
| 6956 | # The next test checks that no datagrams significantly larger than the |
| 6957 | # negotiated MFL are sent. |
| 6958 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6959 | requires_config_enabled MBEDTLS_RSA_C |
| 6960 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6961 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6962 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6963 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6964 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6965 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6966 | crt_file=data_files/server7_int-ca.crt \ |
| 6967 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6968 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6969 | max_frag_len=2048" \ |
| 6970 | "$P_CLI dtls=1 debug_level=2 \ |
| 6971 | crt_file=data_files/server8_int-ca2.crt \ |
| 6972 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6973 | hs_timeout=2500-60000 \ |
| 6974 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6975 | 0 \ |
| 6976 | -s "found fragmented DTLS handshake message" \ |
| 6977 | -c "found fragmented DTLS handshake message" \ |
| 6978 | -C "error" |
| 6979 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6980 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6981 | requires_config_enabled MBEDTLS_RSA_C |
| 6982 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6983 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6984 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6985 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6986 | crt_file=data_files/server7_int-ca.crt \ |
| 6987 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6988 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6989 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6990 | "$P_CLI dtls=1 debug_level=2 \ |
| 6991 | crt_file=data_files/server8_int-ca2.crt \ |
| 6992 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6993 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6994 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6995 | 0 \ |
| 6996 | -S "found fragmented DTLS handshake message" \ |
| 6997 | -C "found fragmented DTLS handshake message" \ |
| 6998 | -C "error" |
| 6999 | |
| 7000 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7001 | requires_config_enabled MBEDTLS_RSA_C |
| 7002 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7003 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7004 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7005 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7006 | crt_file=data_files/server7_int-ca.crt \ |
| 7007 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7008 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7009 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7010 | "$P_CLI dtls=1 debug_level=2 \ |
| 7011 | crt_file=data_files/server8_int-ca2.crt \ |
| 7012 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7013 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7014 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7015 | 0 \ |
| 7016 | -s "found fragmented DTLS handshake message" \ |
| 7017 | -C "found fragmented DTLS handshake message" \ |
| 7018 | -C "error" |
| 7019 | |
| 7020 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7021 | requires_config_enabled MBEDTLS_RSA_C |
| 7022 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7023 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7024 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7025 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7026 | crt_file=data_files/server7_int-ca.crt \ |
| 7027 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7028 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7029 | mtu=512" \ |
| 7030 | "$P_CLI dtls=1 debug_level=2 \ |
| 7031 | crt_file=data_files/server8_int-ca2.crt \ |
| 7032 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7033 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7034 | mtu=2048" \ |
| 7035 | 0 \ |
| 7036 | -S "found fragmented DTLS handshake message" \ |
| 7037 | -c "found fragmented DTLS handshake message" \ |
| 7038 | -C "error" |
| 7039 | |
| 7040 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7041 | requires_config_enabled MBEDTLS_RSA_C |
| 7042 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7043 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7044 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7045 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7046 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7047 | crt_file=data_files/server7_int-ca.crt \ |
| 7048 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7049 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7050 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7051 | "$P_CLI dtls=1 debug_level=2 \ |
| 7052 | crt_file=data_files/server8_int-ca2.crt \ |
| 7053 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7054 | hs_timeout=2500-60000 \ |
| 7055 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7056 | 0 \ |
| 7057 | -s "found fragmented DTLS handshake message" \ |
| 7058 | -c "found fragmented DTLS handshake message" \ |
| 7059 | -C "error" |
| 7060 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7061 | # 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] | 7062 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7063 | requires_config_enabled MBEDTLS_RSA_C |
| 7064 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7065 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7066 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7067 | requires_config_enabled MBEDTLS_AES_C |
| 7068 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7069 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7070 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7071 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7072 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7073 | crt_file=data_files/server7_int-ca.crt \ |
| 7074 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7075 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7076 | mtu=512" \ |
| 7077 | "$P_CLI dtls=1 debug_level=2 \ |
| 7078 | crt_file=data_files/server8_int-ca2.crt \ |
| 7079 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7080 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7081 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7082 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7083 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7084 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7085 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7086 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7087 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7088 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7089 | # 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] | 7090 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7091 | # retransmissions, but in some cases (like both the server and client using |
| 7092 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7093 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7094 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7095 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7096 | requires_config_enabled MBEDTLS_RSA_C |
| 7097 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7098 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7099 | requires_config_enabled MBEDTLS_AES_C |
| 7100 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7101 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7102 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7103 | -p "$P_PXY mtu=508" \ |
| 7104 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7105 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7106 | key_file=data_files/server7.key \ |
| 7107 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7108 | "$P_CLI dtls=1 debug_level=2 \ |
| 7109 | crt_file=data_files/server8_int-ca2.crt \ |
| 7110 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7111 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7112 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7113 | 0 \ |
| 7114 | -s "found fragmented DTLS handshake message" \ |
| 7115 | -c "found fragmented DTLS handshake message" \ |
| 7116 | -C "error" |
| 7117 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7118 | # 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] | 7119 | only_with_valgrind |
| 7120 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7121 | requires_config_enabled MBEDTLS_RSA_C |
| 7122 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7123 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7124 | requires_config_enabled MBEDTLS_AES_C |
| 7125 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7126 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7127 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7128 | -p "$P_PXY mtu=508" \ |
| 7129 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7130 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7131 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7132 | hs_timeout=250-10000" \ |
| 7133 | "$P_CLI dtls=1 debug_level=2 \ |
| 7134 | crt_file=data_files/server8_int-ca2.crt \ |
| 7135 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7136 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7137 | hs_timeout=250-10000" \ |
| 7138 | 0 \ |
| 7139 | -s "found fragmented DTLS handshake message" \ |
| 7140 | -c "found fragmented DTLS handshake message" \ |
| 7141 | -C "error" |
| 7142 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7143 | # 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] | 7144 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7145 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7146 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7147 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7148 | requires_config_enabled MBEDTLS_RSA_C |
| 7149 | requires_config_enabled MBEDTLS_ECDSA_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=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7152 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7156 | hs_timeout=10000-60000 \ |
| 7157 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +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 | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7161 | hs_timeout=10000-60000 \ |
| 7162 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7163 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7164 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7165 | -s "found fragmented DTLS handshake message" \ |
| 7166 | -c "found fragmented DTLS handshake message" \ |
| 7167 | -C "error" |
| 7168 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7169 | # 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] | 7170 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7171 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7172 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7173 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7174 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7175 | requires_config_enabled MBEDTLS_RSA_C |
| 7176 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7177 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7178 | requires_config_enabled MBEDTLS_AES_C |
| 7179 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7180 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7181 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7182 | -p "$P_PXY mtu=512" \ |
| 7183 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7184 | crt_file=data_files/server7_int-ca.crt \ |
| 7185 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7186 | hs_timeout=10000-60000 \ |
| 7187 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7188 | "$P_CLI dtls=1 debug_level=2 \ |
| 7189 | crt_file=data_files/server8_int-ca2.crt \ |
| 7190 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7191 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7192 | hs_timeout=10000-60000 \ |
| 7193 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7194 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7195 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7196 | -s "found fragmented DTLS handshake message" \ |
| 7197 | -c "found fragmented DTLS handshake message" \ |
| 7198 | -C "error" |
| 7199 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7200 | not_with_valgrind # spurious autoreduction due to timeout |
| 7201 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7202 | requires_config_enabled MBEDTLS_RSA_C |
| 7203 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7204 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7205 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7206 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7207 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7208 | crt_file=data_files/server7_int-ca.crt \ |
| 7209 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7210 | hs_timeout=10000-60000 \ |
| 7211 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7212 | "$P_CLI dtls=1 debug_level=2 \ |
| 7213 | crt_file=data_files/server8_int-ca2.crt \ |
| 7214 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7215 | hs_timeout=10000-60000 \ |
| 7216 | mtu=1024 nbio=2" \ |
| 7217 | 0 \ |
| 7218 | -S "autoreduction" \ |
| 7219 | -s "found fragmented DTLS handshake message" \ |
| 7220 | -c "found fragmented DTLS handshake message" \ |
| 7221 | -C "error" |
| 7222 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7223 | # 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] | 7224 | not_with_valgrind # spurious autoreduction due to timeout |
| 7225 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7226 | requires_config_enabled MBEDTLS_RSA_C |
| 7227 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7228 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7229 | requires_config_enabled MBEDTLS_AES_C |
| 7230 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7231 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7232 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7233 | -p "$P_PXY mtu=512" \ |
| 7234 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7235 | crt_file=data_files/server7_int-ca.crt \ |
| 7236 | key_file=data_files/server7.key \ |
| 7237 | hs_timeout=10000-60000 \ |
| 7238 | mtu=512 nbio=2" \ |
| 7239 | "$P_CLI dtls=1 debug_level=2 \ |
| 7240 | crt_file=data_files/server8_int-ca2.crt \ |
| 7241 | key_file=data_files/server8.key \ |
| 7242 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7243 | hs_timeout=10000-60000 \ |
| 7244 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7245 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7246 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7247 | -s "found fragmented DTLS handshake message" \ |
| 7248 | -c "found fragmented DTLS handshake message" \ |
| 7249 | -C "error" |
| 7250 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7251 | # 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] | 7252 | # This ensures things still work after session_reset(). |
| 7253 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7254 | # Since we don't support reading fragmented ClientHello yet, |
| 7255 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7256 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7257 | # An autoreduction on the client-side might happen if the server is |
| 7258 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7259 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7260 | # resumed listening, which would result in a spurious autoreduction. |
| 7261 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7262 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7263 | requires_config_enabled MBEDTLS_RSA_C |
| 7264 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7265 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7266 | requires_config_enabled MBEDTLS_AES_C |
| 7267 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7268 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7269 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7270 | -p "$P_PXY mtu=1450" \ |
| 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 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7274 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7275 | mtu=1450" \ |
| 7276 | "$P_CLI dtls=1 debug_level=2 \ |
| 7277 | crt_file=data_files/server8_int-ca2.crt \ |
| 7278 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7279 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7280 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7281 | 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] | 7282 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7283 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7284 | -s "found fragmented DTLS handshake message" \ |
| 7285 | -c "found fragmented DTLS handshake message" \ |
| 7286 | -C "error" |
| 7287 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7288 | # An autoreduction on the client-side might happen if the server is |
| 7289 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7290 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7291 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7292 | requires_config_enabled MBEDTLS_RSA_C |
| 7293 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7294 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7295 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7296 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7297 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7298 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7299 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7300 | -p "$P_PXY mtu=512" \ |
| 7301 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7302 | crt_file=data_files/server7_int-ca.crt \ |
| 7303 | key_file=data_files/server7.key \ |
| 7304 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7305 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7306 | mtu=512" \ |
| 7307 | "$P_CLI dtls=1 debug_level=2 \ |
| 7308 | crt_file=data_files/server8_int-ca2.crt \ |
| 7309 | key_file=data_files/server8.key \ |
| 7310 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7311 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7312 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7313 | mtu=512" \ |
| 7314 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7315 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7316 | -s "found fragmented DTLS handshake message" \ |
| 7317 | -c "found fragmented DTLS handshake message" \ |
| 7318 | -C "error" |
| 7319 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7320 | # An autoreduction on the client-side might happen if the server is |
| 7321 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7322 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7323 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7324 | requires_config_enabled MBEDTLS_RSA_C |
| 7325 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7326 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7327 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7328 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7329 | requires_config_enabled MBEDTLS_AES_C |
| 7330 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7331 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7332 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7333 | -p "$P_PXY mtu=512" \ |
| 7334 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7335 | crt_file=data_files/server7_int-ca.crt \ |
| 7336 | key_file=data_files/server7.key \ |
| 7337 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7338 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7339 | mtu=512" \ |
| 7340 | "$P_CLI dtls=1 debug_level=2 \ |
| 7341 | crt_file=data_files/server8_int-ca2.crt \ |
| 7342 | key_file=data_files/server8.key \ |
| 7343 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7344 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7345 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7346 | mtu=512" \ |
| 7347 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7348 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7349 | -s "found fragmented DTLS handshake message" \ |
| 7350 | -c "found fragmented DTLS handshake message" \ |
| 7351 | -C "error" |
| 7352 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7353 | # An autoreduction on the client-side might happen if the server is |
| 7354 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7355 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7356 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7357 | requires_config_enabled MBEDTLS_RSA_C |
| 7358 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7359 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7360 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7361 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7362 | requires_config_enabled MBEDTLS_AES_C |
| 7363 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7364 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7365 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7366 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7367 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7368 | crt_file=data_files/server7_int-ca.crt \ |
| 7369 | key_file=data_files/server7.key \ |
| 7370 | exchanges=2 renegotiation=1 \ |
| 7371 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7372 | hs_timeout=10000-60000 \ |
| 7373 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7374 | "$P_CLI dtls=1 debug_level=2 \ |
| 7375 | crt_file=data_files/server8_int-ca2.crt \ |
| 7376 | key_file=data_files/server8.key \ |
| 7377 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7378 | hs_timeout=10000-60000 \ |
| 7379 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7380 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7381 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7382 | -s "found fragmented DTLS handshake message" \ |
| 7383 | -c "found fragmented DTLS handshake message" \ |
| 7384 | -C "error" |
| 7385 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7386 | # An autoreduction on the client-side might happen if the server is |
| 7387 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7388 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7389 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7390 | requires_config_enabled MBEDTLS_RSA_C |
| 7391 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7392 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7393 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7394 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7395 | requires_config_enabled MBEDTLS_AES_C |
| 7396 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7397 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7398 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7399 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7400 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7401 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7402 | crt_file=data_files/server7_int-ca.crt \ |
| 7403 | key_file=data_files/server7.key \ |
| 7404 | exchanges=2 renegotiation=1 \ |
| 7405 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7406 | hs_timeout=10000-60000 \ |
| 7407 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7408 | "$P_CLI dtls=1 debug_level=2 \ |
| 7409 | crt_file=data_files/server8_int-ca2.crt \ |
| 7410 | key_file=data_files/server8.key \ |
| 7411 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7412 | hs_timeout=10000-60000 \ |
| 7413 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7414 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7415 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7416 | -s "found fragmented DTLS handshake message" \ |
| 7417 | -c "found fragmented DTLS handshake message" \ |
| 7418 | -C "error" |
| 7419 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7420 | # An autoreduction on the client-side might happen if the server is |
| 7421 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7422 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7423 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7424 | requires_config_enabled MBEDTLS_RSA_C |
| 7425 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7426 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7427 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7428 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7429 | requires_config_enabled MBEDTLS_AES_C |
| 7430 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7431 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7432 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7433 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7434 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7435 | crt_file=data_files/server7_int-ca.crt \ |
| 7436 | key_file=data_files/server7.key \ |
| 7437 | exchanges=2 renegotiation=1 \ |
| 7438 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7439 | hs_timeout=10000-60000 \ |
| 7440 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7441 | "$P_CLI dtls=1 debug_level=2 \ |
| 7442 | crt_file=data_files/server8_int-ca2.crt \ |
| 7443 | key_file=data_files/server8.key \ |
| 7444 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7445 | hs_timeout=10000-60000 \ |
| 7446 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7447 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7448 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7449 | -s "found fragmented DTLS handshake message" \ |
| 7450 | -c "found fragmented DTLS handshake message" \ |
| 7451 | -C "error" |
| 7452 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7453 | # 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] | 7454 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7455 | requires_config_enabled MBEDTLS_RSA_C |
| 7456 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7457 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7458 | requires_config_enabled MBEDTLS_AES_C |
| 7459 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7460 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7461 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7462 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7463 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7464 | "$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] | 7465 | crt_file=data_files/server7_int-ca.crt \ |
| 7466 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7467 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7468 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7469 | crt_file=data_files/server8_int-ca2.crt \ |
| 7470 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7471 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7472 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7473 | 0 \ |
| 7474 | -s "found fragmented DTLS handshake message" \ |
| 7475 | -c "found fragmented DTLS handshake message" \ |
| 7476 | -C "error" |
| 7477 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7478 | # 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] | 7479 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7480 | requires_config_enabled MBEDTLS_RSA_C |
| 7481 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7482 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7483 | requires_config_enabled MBEDTLS_AES_C |
| 7484 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7485 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7486 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7487 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7488 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7489 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7490 | crt_file=data_files/server7_int-ca.crt \ |
| 7491 | key_file=data_files/server7.key \ |
| 7492 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7493 | "$P_CLI dtls=1 debug_level=2 \ |
| 7494 | crt_file=data_files/server8_int-ca2.crt \ |
| 7495 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7496 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7497 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7498 | 0 \ |
| 7499 | -s "found fragmented DTLS handshake message" \ |
| 7500 | -c "found fragmented DTLS handshake message" \ |
| 7501 | -C "error" |
| 7502 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7503 | # interop tests for DTLS fragmentating with reliable connection |
| 7504 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7505 | # here and below we just want to test that the we fragment in a way that |
| 7506 | # pleases other implementations, so we don't need the peer to fragment |
| 7507 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7508 | requires_config_enabled MBEDTLS_RSA_C |
| 7509 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7511 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7512 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7513 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7514 | "$G_SRV -u" \ |
| 7515 | "$P_CLI dtls=1 debug_level=2 \ |
| 7516 | crt_file=data_files/server8_int-ca2.crt \ |
| 7517 | key_file=data_files/server8.key \ |
| 7518 | mtu=512 force_version=dtls1_2" \ |
| 7519 | 0 \ |
| 7520 | -c "fragmenting handshake message" \ |
| 7521 | -C "error" |
| 7522 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7523 | # We use --insecure for the GnuTLS client because it expects |
| 7524 | # the hostname / IP it connects to to be the name used in the |
| 7525 | # certificate obtained from the server. Here, however, it |
| 7526 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7527 | # as the server name in the certificate. This will make the |
| 7528 | # certifiate validation fail, but passing --insecure makes |
| 7529 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7530 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7531 | requires_config_enabled MBEDTLS_RSA_C |
| 7532 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7534 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7535 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7536 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7537 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7538 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7539 | crt_file=data_files/server7_int-ca.crt \ |
| 7540 | key_file=data_files/server7.key \ |
| 7541 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7542 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7543 | 0 \ |
| 7544 | -s "fragmenting handshake message" |
| 7545 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7546 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7547 | requires_config_enabled MBEDTLS_RSA_C |
| 7548 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7550 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7551 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7552 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7553 | "$P_CLI dtls=1 debug_level=2 \ |
| 7554 | crt_file=data_files/server8_int-ca2.crt \ |
| 7555 | key_file=data_files/server8.key \ |
| 7556 | mtu=512 force_version=dtls1_2" \ |
| 7557 | 0 \ |
| 7558 | -c "fragmenting handshake message" \ |
| 7559 | -C "error" |
| 7560 | |
| 7561 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7562 | requires_config_enabled MBEDTLS_RSA_C |
| 7563 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7565 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7566 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7567 | "$P_SRV dtls=1 debug_level=2 \ |
| 7568 | crt_file=data_files/server7_int-ca.crt \ |
| 7569 | key_file=data_files/server7.key \ |
| 7570 | mtu=512 force_version=dtls1_2" \ |
| 7571 | "$O_CLI -dtls1_2" \ |
| 7572 | 0 \ |
| 7573 | -s "fragmenting handshake message" |
| 7574 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7575 | # interop tests for DTLS fragmentating with unreliable connection |
| 7576 | # |
| 7577 | # again we just want to test that the we fragment in a way that |
| 7578 | # pleases other implementations, so we don't need the peer to fragment |
| 7579 | requires_gnutls_next |
| 7580 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7581 | requires_config_enabled MBEDTLS_RSA_C |
| 7582 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7584 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7585 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7586 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7587 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7588 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7589 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7590 | crt_file=data_files/server8_int-ca2.crt \ |
| 7591 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7592 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7593 | 0 \ |
| 7594 | -c "fragmenting handshake message" \ |
| 7595 | -C "error" |
| 7596 | |
| 7597 | requires_gnutls_next |
| 7598 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7599 | requires_config_enabled MBEDTLS_RSA_C |
| 7600 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7602 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7603 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7604 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7605 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7606 | "$P_SRV dtls=1 debug_level=2 \ |
| 7607 | crt_file=data_files/server7_int-ca.crt \ |
| 7608 | key_file=data_files/server7.key \ |
| 7609 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7610 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7611 | 0 \ |
| 7612 | -s "fragmenting handshake message" |
| 7613 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7614 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7615 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7616 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7617 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7618 | ## (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] | 7619 | skip_next_test |
| 7620 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7621 | requires_config_enabled MBEDTLS_RSA_C |
| 7622 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7624 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7625 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7626 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7627 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7628 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7629 | "$P_CLI dtls=1 debug_level=2 \ |
| 7630 | crt_file=data_files/server8_int-ca2.crt \ |
| 7631 | key_file=data_files/server8.key \ |
| 7632 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7633 | 0 \ |
| 7634 | -c "fragmenting handshake message" \ |
| 7635 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7636 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7637 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7638 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7639 | requires_config_enabled MBEDTLS_RSA_C |
| 7640 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7642 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7643 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7644 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7645 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7646 | "$P_SRV dtls=1 debug_level=2 \ |
| 7647 | crt_file=data_files/server7_int-ca.crt \ |
| 7648 | key_file=data_files/server7.key \ |
| 7649 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7650 | "$O_CLI -dtls1_2" \ |
| 7651 | 0 \ |
| 7652 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7653 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7654 | # Tests for DTLS-SRTP (RFC 5764) |
| 7655 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7656 | run_test "DTLS-SRTP all profiles supported" \ |
| 7657 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7658 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7659 | 0 \ |
| 7660 | -s "found use_srtp extension" \ |
| 7661 | -s "found srtp profile" \ |
| 7662 | -s "selected srtp profile" \ |
| 7663 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7664 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7665 | -c "client hello, adding use_srtp extension" \ |
| 7666 | -c "found use_srtp extension" \ |
| 7667 | -c "found srtp profile" \ |
| 7668 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7669 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7670 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7671 | -C "error" |
| 7672 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7673 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7674 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7675 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7676 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7677 | "$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] | 7678 | 0 \ |
| 7679 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7680 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7681 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7682 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7683 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7684 | -c "client hello, adding use_srtp extension" \ |
| 7685 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7686 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7687 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7688 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7689 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7690 | -C "error" |
| 7691 | |
| 7692 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7693 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7694 | "$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] | 7695 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7696 | 0 \ |
| 7697 | -s "found use_srtp extension" \ |
| 7698 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7699 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7700 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7701 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7702 | -c "client hello, adding use_srtp extension" \ |
| 7703 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7704 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7705 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7706 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7707 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7708 | -C "error" |
| 7709 | |
| 7710 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7711 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7712 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7713 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7714 | 0 \ |
| 7715 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7716 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7717 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7718 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7719 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7720 | -c "client hello, adding use_srtp extension" \ |
| 7721 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7722 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7723 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7724 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7725 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7726 | -C "error" |
| 7727 | |
| 7728 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7729 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 7730 | "$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] | 7731 | "$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] | 7732 | 0 \ |
| 7733 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7734 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7735 | -S "selected srtp profile" \ |
| 7736 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7737 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7738 | -c "client hello, adding use_srtp extension" \ |
| 7739 | -C "found use_srtp extension" \ |
| 7740 | -C "found srtp profile" \ |
| 7741 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7742 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7743 | -C "error" |
| 7744 | |
| 7745 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7746 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7747 | "$P_SRV dtls=1 debug_level=3" \ |
| 7748 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7749 | 0 \ |
| 7750 | -s "found use_srtp extension" \ |
| 7751 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7752 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7753 | -c "client hello, adding use_srtp extension" \ |
| 7754 | -C "found use_srtp extension" \ |
| 7755 | -C "found srtp profile" \ |
| 7756 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7757 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7758 | -C "error" |
| 7759 | |
| 7760 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7761 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 7762 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 7763 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7764 | 0 \ |
| 7765 | -s "found use_srtp extension" \ |
| 7766 | -s "found srtp profile" \ |
| 7767 | -s "selected srtp profile" \ |
| 7768 | -s "server hello, adding use_srtp extension" \ |
| 7769 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7770 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7771 | -c "client hello, adding use_srtp extension" \ |
| 7772 | -c "found use_srtp extension" \ |
| 7773 | -c "found srtp profile" \ |
| 7774 | -c "selected srtp profile" \ |
| 7775 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7776 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7777 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7778 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7779 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7780 | -C "error" |
| 7781 | |
| 7782 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7783 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7784 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7785 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7786 | 0 \ |
| 7787 | -s "found use_srtp extension" \ |
| 7788 | -s "found srtp profile" \ |
| 7789 | -s "selected srtp profile" \ |
| 7790 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7791 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7792 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7793 | -S "dumping 'using mki' (8 bytes)" \ |
| 7794 | -c "client hello, adding use_srtp extension" \ |
| 7795 | -c "found use_srtp extension" \ |
| 7796 | -c "found srtp profile" \ |
| 7797 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7798 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7799 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7800 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7801 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7802 | -C "dumping 'received mki' (8 bytes)" \ |
| 7803 | -C "error" |
| 7804 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7805 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7806 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7807 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7808 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7809 | 0 \ |
| 7810 | -s "found use_srtp extension" \ |
| 7811 | -s "found srtp profile" \ |
| 7812 | -s "selected srtp profile" \ |
| 7813 | -s "server hello, adding use_srtp extension" \ |
| 7814 | -s "DTLS-SRTP key material is"\ |
| 7815 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7816 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7817 | |
| 7818 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7819 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7820 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7821 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7822 | 0 \ |
| 7823 | -s "found use_srtp extension" \ |
| 7824 | -s "found srtp profile" \ |
| 7825 | -s "selected srtp profile" \ |
| 7826 | -s "server hello, adding use_srtp extension" \ |
| 7827 | -s "DTLS-SRTP key material is"\ |
| 7828 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7829 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7830 | |
| 7831 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7832 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7833 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7834 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7835 | 0 \ |
| 7836 | -s "found use_srtp extension" \ |
| 7837 | -s "found srtp profile" \ |
| 7838 | -s "selected srtp profile" \ |
| 7839 | -s "server hello, adding use_srtp extension" \ |
| 7840 | -s "DTLS-SRTP key material is"\ |
| 7841 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7842 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7843 | |
| 7844 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7845 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7846 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7847 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7848 | 0 \ |
| 7849 | -s "found use_srtp extension" \ |
| 7850 | -s "found srtp profile" \ |
| 7851 | -s "selected srtp profile" \ |
| 7852 | -s "server hello, adding use_srtp extension" \ |
| 7853 | -s "DTLS-SRTP key material is"\ |
| 7854 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7855 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7856 | |
| 7857 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7858 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7859 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7860 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7861 | 0 \ |
| 7862 | -s "found use_srtp extension" \ |
| 7863 | -s "found srtp profile" \ |
| 7864 | -s "selected srtp profile" \ |
| 7865 | -s "server hello, adding use_srtp extension" \ |
| 7866 | -s "DTLS-SRTP key material is"\ |
| 7867 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7868 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7869 | |
| 7870 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7871 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7872 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7873 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7874 | 0 \ |
| 7875 | -s "found use_srtp extension" \ |
| 7876 | -s "found srtp profile" \ |
| 7877 | -S "selected srtp profile" \ |
| 7878 | -S "server hello, adding use_srtp extension" \ |
| 7879 | -S "DTLS-SRTP key material is"\ |
| 7880 | -C "SRTP Extension negotiated, profile" |
| 7881 | |
| 7882 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7883 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7884 | "$P_SRV dtls=1 debug_level=3" \ |
| 7885 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7886 | 0 \ |
| 7887 | -s "found use_srtp extension" \ |
| 7888 | -S "server hello, adding use_srtp extension" \ |
| 7889 | -S "DTLS-SRTP key material is"\ |
| 7890 | -C "SRTP Extension negotiated, profile" |
| 7891 | |
| 7892 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7893 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7894 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7895 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7896 | 0 \ |
| 7897 | -c "client hello, adding use_srtp extension" \ |
| 7898 | -c "found use_srtp extension" \ |
| 7899 | -c "found srtp profile" \ |
| 7900 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7901 | -c "DTLS-SRTP key material is"\ |
| 7902 | -C "error" |
| 7903 | |
| 7904 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7905 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7906 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7907 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7908 | 0 \ |
| 7909 | -c "client hello, adding use_srtp extension" \ |
| 7910 | -c "found use_srtp extension" \ |
| 7911 | -c "found srtp profile" \ |
| 7912 | -c "selected srtp profile" \ |
| 7913 | -c "DTLS-SRTP key material is"\ |
| 7914 | -C "error" |
| 7915 | |
| 7916 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7917 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7918 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7919 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7920 | 0 \ |
| 7921 | -c "client hello, adding use_srtp extension" \ |
| 7922 | -c "found use_srtp extension" \ |
| 7923 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7924 | -c "selected srtp profile" \ |
| 7925 | -c "DTLS-SRTP key material is"\ |
| 7926 | -C "error" |
| 7927 | |
| 7928 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7929 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7930 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7931 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7932 | 0 \ |
| 7933 | -c "client hello, adding use_srtp extension" \ |
| 7934 | -c "found use_srtp extension" \ |
| 7935 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7936 | -c "selected srtp profile" \ |
| 7937 | -c "DTLS-SRTP key material is"\ |
| 7938 | -C "error" |
| 7939 | |
| 7940 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7941 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7942 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7943 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7944 | 0 \ |
| 7945 | -c "client hello, adding use_srtp extension" \ |
| 7946 | -c "found use_srtp extension" \ |
| 7947 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7948 | -c "selected srtp profile" \ |
| 7949 | -c "DTLS-SRTP key material is"\ |
| 7950 | -C "error" |
| 7951 | |
| 7952 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7953 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 7954 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7955 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 7956 | 0 \ |
| 7957 | -c "client hello, adding use_srtp extension" \ |
| 7958 | -C "found use_srtp extension" \ |
| 7959 | -C "found srtp profile" \ |
| 7960 | -C "selected srtp profile" \ |
| 7961 | -C "DTLS-SRTP key material is"\ |
| 7962 | -C "error" |
| 7963 | |
| 7964 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7965 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 7966 | "$O_SRV -dtls" \ |
| 7967 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7968 | 0 \ |
| 7969 | -c "client hello, adding use_srtp extension" \ |
| 7970 | -C "found use_srtp extension" \ |
| 7971 | -C "found srtp profile" \ |
| 7972 | -C "selected srtp profile" \ |
| 7973 | -C "DTLS-SRTP key material is"\ |
| 7974 | -C "error" |
| 7975 | |
| 7976 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7977 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 7978 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7979 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7980 | 0 \ |
| 7981 | -c "client hello, adding use_srtp extension" \ |
| 7982 | -c "found use_srtp extension" \ |
| 7983 | -c "found srtp profile" \ |
| 7984 | -c "selected srtp profile" \ |
| 7985 | -c "DTLS-SRTP key material is"\ |
| 7986 | -c "DTLS-SRTP no mki value negotiated"\ |
| 7987 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7988 | -C "dumping 'received mki' (8 bytes)" \ |
| 7989 | -C "error" |
| 7990 | |
| 7991 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7992 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7993 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7994 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7995 | "$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] | 7996 | 0 \ |
| 7997 | -s "found use_srtp extension" \ |
| 7998 | -s "found srtp profile" \ |
| 7999 | -s "selected srtp profile" \ |
| 8000 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8001 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8002 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8003 | |
| 8004 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8005 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8006 | 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] | 8007 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8008 | "$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] | 8009 | 0 \ |
| 8010 | -s "found use_srtp extension" \ |
| 8011 | -s "found srtp profile" \ |
| 8012 | -s "selected srtp profile" \ |
| 8013 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8014 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8015 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8016 | |
| 8017 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8018 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8019 | 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] | 8020 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8021 | "$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] | 8022 | 0 \ |
| 8023 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8024 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8025 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8026 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8027 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8028 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8029 | |
| 8030 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8031 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8032 | 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] | 8033 | "$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] | 8034 | "$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] | 8035 | 0 \ |
| 8036 | -s "found use_srtp extension" \ |
| 8037 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8038 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8039 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8040 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8041 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8042 | |
| 8043 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8044 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8045 | 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] | 8046 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8047 | "$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] | 8048 | 0 \ |
| 8049 | -s "found use_srtp extension" \ |
| 8050 | -s "found srtp profile" \ |
| 8051 | -s "selected srtp profile" \ |
| 8052 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8053 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8054 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8055 | |
| 8056 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8057 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8058 | 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] | 8059 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8060 | "$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] | 8061 | 0 \ |
| 8062 | -s "found use_srtp extension" \ |
| 8063 | -s "found srtp profile" \ |
| 8064 | -S "selected srtp profile" \ |
| 8065 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8066 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8067 | -C "SRTP profile:" |
| 8068 | |
| 8069 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8070 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8071 | 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] | 8072 | "$P_SRV dtls=1 debug_level=3" \ |
| 8073 | "$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] | 8074 | 0 \ |
| 8075 | -s "found use_srtp extension" \ |
| 8076 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8077 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8078 | -C "SRTP profile:" |
| 8079 | |
| 8080 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8081 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8082 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8083 | "$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" \ |
| 8084 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8085 | 0 \ |
| 8086 | -c "client hello, adding use_srtp extension" \ |
| 8087 | -c "found use_srtp extension" \ |
| 8088 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8089 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8090 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8091 | -C "error" |
| 8092 | |
| 8093 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8094 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8095 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8096 | "$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" \ |
| 8097 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8098 | 0 \ |
| 8099 | -c "client hello, adding use_srtp extension" \ |
| 8100 | -c "found use_srtp extension" \ |
| 8101 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8102 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8103 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8104 | -C "error" |
| 8105 | |
| 8106 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8107 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8108 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8109 | "$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" \ |
| 8110 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8111 | 0 \ |
| 8112 | -c "client hello, adding use_srtp extension" \ |
| 8113 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8114 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8115 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8116 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8117 | -C "error" |
| 8118 | |
| 8119 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8120 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8121 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8122 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8123 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8124 | 0 \ |
| 8125 | -c "client hello, adding use_srtp extension" \ |
| 8126 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8127 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8128 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8129 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8130 | -C "error" |
| 8131 | |
| 8132 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8133 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8134 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8135 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8136 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8137 | 0 \ |
| 8138 | -c "client hello, adding use_srtp extension" \ |
| 8139 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8140 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8141 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8142 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8143 | -C "error" |
| 8144 | |
| 8145 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8146 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8147 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8148 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8149 | "$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] | 8150 | 0 \ |
| 8151 | -c "client hello, adding use_srtp extension" \ |
| 8152 | -C "found use_srtp extension" \ |
| 8153 | -C "found srtp profile" \ |
| 8154 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8155 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8156 | -C "error" |
| 8157 | |
| 8158 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8159 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8160 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8161 | "$G_SRV -u" \ |
| 8162 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8163 | 0 \ |
| 8164 | -c "client hello, adding use_srtp extension" \ |
| 8165 | -C "found use_srtp extension" \ |
| 8166 | -C "found srtp profile" \ |
| 8167 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8168 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8169 | -C "error" |
| 8170 | |
| 8171 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8172 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8173 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8174 | "$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" \ |
| 8175 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8176 | 0 \ |
| 8177 | -c "client hello, adding use_srtp extension" \ |
| 8178 | -c "found use_srtp extension" \ |
| 8179 | -c "found srtp profile" \ |
| 8180 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8181 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8182 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8183 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8184 | -c "dumping 'received mki' (8 bytes)" \ |
| 8185 | -C "error" |
| 8186 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8187 | # Tests for specific things with "unreliable" UDP connection |
| 8188 | |
| 8189 | not_with_valgrind # spurious resend due to timeout |
| 8190 | run_test "DTLS proxy: reference" \ |
| 8191 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8192 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8193 | "$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] | 8194 | 0 \ |
| 8195 | -C "replayed record" \ |
| 8196 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8197 | -C "Buffer record from epoch" \ |
| 8198 | -S "Buffer record from epoch" \ |
| 8199 | -C "ssl_buffer_message" \ |
| 8200 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8201 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8202 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8203 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8204 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8205 | -c "HTTP/1.0 200 OK" |
| 8206 | |
| 8207 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8208 | run_test "DTLS proxy: duplicate every packet" \ |
| 8209 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8210 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8211 | "$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] | 8212 | 0 \ |
| 8213 | -c "replayed record" \ |
| 8214 | -s "replayed record" \ |
| 8215 | -c "record from another epoch" \ |
| 8216 | -s "record from another epoch" \ |
| 8217 | -S "resend" \ |
| 8218 | -s "Extra-header:" \ |
| 8219 | -c "HTTP/1.0 200 OK" |
| 8220 | |
| 8221 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8222 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8223 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8224 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8225 | 0 \ |
| 8226 | -c "replayed record" \ |
| 8227 | -S "replayed record" \ |
| 8228 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8229 | -s "record from another epoch" \ |
| 8230 | -c "resend" \ |
| 8231 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8232 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8233 | -c "HTTP/1.0 200 OK" |
| 8234 | |
| 8235 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8236 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8237 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8238 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8239 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8240 | -c "next record in same datagram" \ |
| 8241 | -s "next record in same datagram" |
| 8242 | |
| 8243 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8244 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8245 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8246 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8247 | 0 \ |
| 8248 | -c "next record in same datagram" \ |
| 8249 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8250 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8251 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8252 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8253 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8254 | "$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] | 8255 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8256 | -c "discarding invalid record (mac)" \ |
| 8257 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8258 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8259 | -c "HTTP/1.0 200 OK" \ |
| 8260 | -S "too many records with bad MAC" \ |
| 8261 | -S "Verification of the message MAC failed" |
| 8262 | |
| 8263 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8264 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8265 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8266 | "$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] | 8267 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8268 | -C "discarding invalid record (mac)" \ |
| 8269 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8270 | -S "Extra-header:" \ |
| 8271 | -C "HTTP/1.0 200 OK" \ |
| 8272 | -s "too many records with bad MAC" \ |
| 8273 | -s "Verification of the message MAC failed" |
| 8274 | |
| 8275 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8276 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8277 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8278 | "$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] | 8279 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8280 | -c "discarding invalid record (mac)" \ |
| 8281 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8282 | -s "Extra-header:" \ |
| 8283 | -c "HTTP/1.0 200 OK" \ |
| 8284 | -S "too many records with bad MAC" \ |
| 8285 | -S "Verification of the message MAC failed" |
| 8286 | |
| 8287 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8288 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8289 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8290 | "$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] | 8291 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8292 | -c "discarding invalid record (mac)" \ |
| 8293 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8294 | -s "Extra-header:" \ |
| 8295 | -c "HTTP/1.0 200 OK" \ |
| 8296 | -s "too many records with bad MAC" \ |
| 8297 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8298 | |
| 8299 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8300 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8301 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8302 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8303 | 0 \ |
| 8304 | -c "record from another epoch" \ |
| 8305 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8306 | -s "Extra-header:" \ |
| 8307 | -c "HTTP/1.0 200 OK" |
| 8308 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8309 | # Tests for reordering support with DTLS |
| 8310 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8311 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8312 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8313 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8314 | hs_timeout=2500-60000" \ |
| 8315 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8316 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8317 | 0 \ |
| 8318 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8319 | -c "Next handshake message has been buffered - load"\ |
| 8320 | -S "Buffering HS message" \ |
| 8321 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8322 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8323 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8324 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8325 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8326 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8327 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8328 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8329 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8330 | hs_timeout=2500-60000" \ |
| 8331 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8332 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8333 | 0 \ |
| 8334 | -c "Buffering HS message" \ |
| 8335 | -c "found fragmented DTLS handshake message"\ |
| 8336 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8337 | -c "Next handshake message has been buffered - load"\ |
| 8338 | -S "Buffering HS message" \ |
| 8339 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8340 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8341 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8342 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8343 | -S "Remember CCS message" |
| 8344 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8345 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8346 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8347 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8348 | # while keeping the ServerKeyExchange. |
| 8349 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8350 | 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] | 8351 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8352 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8353 | hs_timeout=2500-60000" \ |
| 8354 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8355 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8356 | 0 \ |
| 8357 | -c "Buffering HS message" \ |
| 8358 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8359 | -C "attempt to make space by freeing buffered messages" \ |
| 8360 | -S "Buffering HS message" \ |
| 8361 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8362 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8363 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8364 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8365 | -S "Remember CCS message" |
| 8366 | |
| 8367 | # The size constraints ensure that the delayed certificate message can't |
| 8368 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8369 | # when dropping it first. |
| 8370 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8371 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8372 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8373 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8374 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8375 | hs_timeout=2500-60000" \ |
| 8376 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8377 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8378 | 0 \ |
| 8379 | -c "Buffering HS message" \ |
| 8380 | -c "attempt to make space by freeing buffered future messages" \ |
| 8381 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8382 | -S "Buffering HS message" \ |
| 8383 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8384 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8385 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8386 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8387 | -S "Remember CCS message" |
| 8388 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8389 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8390 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8391 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8392 | hs_timeout=2500-60000" \ |
| 8393 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8394 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8395 | 0 \ |
| 8396 | -C "Buffering HS message" \ |
| 8397 | -C "Next handshake message has been buffered - load"\ |
| 8398 | -s "Buffering HS message" \ |
| 8399 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8400 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8401 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8402 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8403 | -S "Remember CCS message" |
| 8404 | |
| 8405 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8406 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8407 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8408 | hs_timeout=2500-60000" \ |
| 8409 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8410 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8411 | 0 \ |
| 8412 | -C "Buffering HS message" \ |
| 8413 | -C "Next handshake message has been buffered - load"\ |
| 8414 | -S "Buffering HS message" \ |
| 8415 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8416 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8417 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8418 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8419 | -S "Remember CCS message" |
| 8420 | |
| 8421 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8422 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8423 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8424 | hs_timeout=2500-60000" \ |
| 8425 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8426 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8427 | 0 \ |
| 8428 | -C "Buffering HS message" \ |
| 8429 | -C "Next handshake message has been buffered - load"\ |
| 8430 | -S "Buffering HS message" \ |
| 8431 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8432 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8433 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8434 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8435 | -s "Remember CCS message" |
| 8436 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8437 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8438 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8439 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8440 | hs_timeout=2500-60000" \ |
| 8441 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8442 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8443 | 0 \ |
| 8444 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8445 | -s "Found buffered record from current epoch - load" \ |
| 8446 | -c "Buffer record from epoch 1" \ |
| 8447 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8448 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8449 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8450 | # from the server are delayed, so that the encrypted Finished message |
| 8451 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8452 | # in afterwards, the encrypted Finished message must be freed in order |
| 8453 | # to make space for the NewSessionTicket to be reassembled. |
| 8454 | # This works only in very particular circumstances: |
| 8455 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8456 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8457 | # the encrypted Finished message. |
| 8458 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8459 | # needs to be fragmented. |
| 8460 | # - All messages sent by the server must be small enough to be either sent |
| 8461 | # without fragmentation or be reassembled within the bounds of |
| 8462 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8463 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8464 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8465 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8466 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8467 | -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] | 8468 | "$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] | 8469 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8470 | 0 \ |
| 8471 | -s "Buffer record from epoch 1" \ |
| 8472 | -s "Found buffered record from current epoch - load" \ |
| 8473 | -c "Buffer record from epoch 1" \ |
| 8474 | -C "Found buffered record from current epoch - load" \ |
| 8475 | -c "Enough space available after freeing future epoch record" |
| 8476 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8477 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8478 | |
| 8479 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8480 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 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=none \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8483 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8484 | "$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] | 8485 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8486 | 0 \ |
| 8487 | -s "Extra-header:" \ |
| 8488 | -c "HTTP/1.0 200 OK" |
| 8489 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8490 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8491 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8492 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8493 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8494 | "$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] | 8495 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8496 | 0 \ |
| 8497 | -s "Extra-header:" \ |
| 8498 | -c "HTTP/1.0 200 OK" |
| 8499 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8500 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8501 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8502 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8503 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8504 | "$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] | 8505 | 0 \ |
| 8506 | -s "Extra-header:" \ |
| 8507 | -c "HTTP/1.0 200 OK" |
| 8508 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8509 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8510 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8511 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8512 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8513 | "$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] | 8514 | 0 \ |
| 8515 | -s "Extra-header:" \ |
| 8516 | -c "HTTP/1.0 200 OK" |
| 8517 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8518 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8519 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8520 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8521 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8522 | "$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] | 8523 | 0 \ |
| 8524 | -s "Extra-header:" \ |
| 8525 | -c "HTTP/1.0 200 OK" |
| 8526 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8527 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8528 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8529 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8530 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8531 | "$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] | 8532 | 0 \ |
| 8533 | -s "Extra-header:" \ |
| 8534 | -c "HTTP/1.0 200 OK" |
| 8535 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8536 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8537 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8538 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8539 | "$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] | 8540 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8541 | "$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] | 8542 | 0 \ |
| 8543 | -s "Extra-header:" \ |
| 8544 | -c "HTTP/1.0 200 OK" |
| 8545 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8546 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8547 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8548 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8549 | "$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] | 8550 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8551 | "$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] | 8552 | 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] | 8553 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8554 | 0 \ |
| 8555 | -s "a session has been resumed" \ |
| 8556 | -c "a session has been resumed" \ |
| 8557 | -s "Extra-header:" \ |
| 8558 | -c "HTTP/1.0 200 OK" |
| 8559 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8560 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8561 | run_test "DTLS proxy: 3d, min handshake, resumption, 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 | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8564 | psk=abc123 debug_level=3 nbio=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 | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8566 | 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] | 8567 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8568 | 0 \ |
| 8569 | -s "a session has been resumed" \ |
| 8570 | -c "a session has been resumed" \ |
| 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 | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8576 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +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 | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 8579 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8580 | "$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] | 8581 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8582 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8583 | 0 \ |
| 8584 | -c "=> renegotiate" \ |
| 8585 | -s "=> renegotiate" \ |
| 8586 | -s "Extra-header:" \ |
| 8587 | -c "HTTP/1.0 200 OK" |
| 8588 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8589 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8590 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8591 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8592 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8593 | "$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] | 8594 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8595 | "$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] | 8596 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8597 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8598 | 0 \ |
| 8599 | -c "=> renegotiate" \ |
| 8600 | -s "=> renegotiate" \ |
| 8601 | -s "Extra-header:" \ |
| 8602 | -c "HTTP/1.0 200 OK" |
| 8603 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8604 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8605 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8606 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8607 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8608 | "$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] | 8609 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8610 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8611 | "$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] | 8612 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8613 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8614 | 0 \ |
| 8615 | -c "=> renegotiate" \ |
| 8616 | -s "=> renegotiate" \ |
| 8617 | -s "Extra-header:" \ |
| 8618 | -c "HTTP/1.0 200 OK" |
| 8619 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8620 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8621 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8622 | 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] | 8623 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8624 | "$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] | 8625 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8626 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8627 | "$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] | 8628 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8629 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8630 | 0 \ |
| 8631 | -c "=> renegotiate" \ |
| 8632 | -s "=> renegotiate" \ |
| 8633 | -s "Extra-header:" \ |
| 8634 | -c "HTTP/1.0 200 OK" |
| 8635 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8636 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8637 | ## all versions installed on the CI machines), reported here: |
| 8638 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8639 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8640 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8641 | skip_next_test |
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, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8645 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8646 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8647 | "$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] | 8648 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8649 | -c "HTTP/1.0 200 OK" |
| 8650 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8651 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8652 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8653 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8654 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8655 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8656 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8657 | "$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] | 8658 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8659 | -c "HTTP/1.0 200 OK" |
| 8660 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8661 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8662 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8663 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8664 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8665 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8666 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8667 | "$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] | 8668 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8669 | -c "HTTP/1.0 200 OK" |
| 8670 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8671 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8672 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8673 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8674 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8675 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8676 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8677 | "$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] | 8678 | 0 \ |
| 8679 | -s "Extra-header:" \ |
| 8680 | -c "Extra-header:" |
| 8681 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8682 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8683 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8684 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8685 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8686 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8687 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8688 | "$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] | 8689 | 0 \ |
| 8690 | -s "Extra-header:" \ |
| 8691 | -c "Extra-header:" |
| 8692 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8693 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8694 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8695 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8696 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8697 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8698 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8699 | "$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] | 8700 | 0 \ |
| 8701 | -s "Extra-header:" \ |
| 8702 | -c "Extra-header:" |
| 8703 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8704 | run_test "export keys functionality" \ |
| 8705 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8706 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8707 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8708 | -c "EAP-TLS key material is:"\ |
| 8709 | -s "EAP-TLS key material is:"\ |
| 8710 | -c "EAP-TLS IV is:" \ |
| 8711 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8712 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8713 | # openssl feature tests: check if tls1.3 exists. |
| 8714 | requires_openssl_tls1_3 |
| 8715 | run_test "TLS1.3: Test openssl tls1_3 feature" \ |
| 8716 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 8717 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 8718 | 0 \ |
| 8719 | -c "TLS 1.3" \ |
| 8720 | -s "TLS 1.3" |
| 8721 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 8722 | # 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] | 8723 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8724 | requires_gnutls_next_no_ticket |
| 8725 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8726 | run_test "TLS1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8727 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 8728 | "$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] | 8729 | 0 \ |
| 8730 | -s "Version: TLS1.3" \ |
| 8731 | -c "Version: TLS1.3" |
| 8732 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8733 | # TLS1.3 test cases |
| 8734 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 8735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8737 | skip_handshake_stage_check |
| 8738 | run_test "TLS1.3: Not supported version check: tls1_2 and tls1_3" \ |
| 8739 | "$P_SRV debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8740 | "$P_CLI debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8741 | 1 \ |
| 8742 | -s "SSL - The requested feature is not available" \ |
| 8743 | -c "SSL - The requested feature is not available" \ |
| 8744 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 8745 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 8746 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8748 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8749 | run_test "TLS1.3: handshake dispatch test: tls1_3 only" \ |
Jerry Yu | 3523a3b | 2021-09-14 16:29:49 +0800 | [diff] [blame] | 8750 | "$P_SRV debug_level=2 min_version=tls1_3 max_version=tls1_3" \ |
| 8751 | "$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] | 8752 | 1 \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8753 | -s "tls1_3 server state: 0" \ |
| 8754 | -c "tls1_3 client state: 0" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8755 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8756 | requires_openssl_tls1_3 |
| 8757 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8758 | run_test "TLS1.3: Test client hello msg work - openssl" \ |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8759 | "$O_NEXT_SRV -tls1_3 -msg" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8760 | "$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] | 8761 | 1 \ |
| 8762 | -c "SSL - The requested feature is not available" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8763 | -s "ServerHello" \ |
| 8764 | -c "tls1_3 client state: 0" \ |
| 8765 | -c "tls1_3 client state: 2" \ |
| 8766 | -c "tls1_3 client state: 19" \ |
| 8767 | -c "tls1_3 client state: 5" \ |
| 8768 | -c "tls1_3 client state: 3" \ |
| 8769 | -c "tls1_3 client state: 9" \ |
| 8770 | -c "tls1_3 client state: 13" \ |
| 8771 | -c "tls1_3 client state: 7" \ |
| 8772 | -c "tls1_3 client state: 20" \ |
| 8773 | -c "tls1_3 client state: 11" \ |
| 8774 | -c "tls1_3 client state: 14" \ |
| 8775 | -c "tls1_3 client state: 15" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8776 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8777 | requires_gnutls_tls1_3 |
| 8778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8779 | run_test "TLS1.3: Test client hello msg work - gnutls" \ |
| 8780 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --debug=4" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8781 | "$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] | 8782 | 1 \ |
| 8783 | -c "SSL - The requested feature is not available" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8784 | -s "SERVER HELLO was queued" \ |
| 8785 | -c "tls1_3 client state: 0" \ |
| 8786 | -c "tls1_3 client state: 2" \ |
| 8787 | -c "tls1_3 client state: 19" \ |
| 8788 | -c "tls1_3 client state: 5" \ |
| 8789 | -c "tls1_3 client state: 3" \ |
| 8790 | -c "tls1_3 client state: 9" \ |
| 8791 | -c "tls1_3 client state: 13" \ |
| 8792 | -c "tls1_3 client state: 7" \ |
| 8793 | -c "tls1_3 client state: 20" \ |
| 8794 | -c "tls1_3 client state: 11" \ |
| 8795 | -c "tls1_3 client state: 14" \ |
| 8796 | -c "tls1_3 client state: 15" |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8797 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8798 | # Test heap memory usage after handshake |
| 8799 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8800 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8801 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8802 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8803 | run_tests_memory_after_hanshake |
| 8804 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8805 | # Final report |
| 8806 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8807 | echo "------------------------------------------------------------------------" |
| 8808 | |
| 8809 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8810 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8811 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8812 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8813 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8814 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8815 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8816 | |
| 8817 | exit $FAILS |