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() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 655 | newline=' |
| 656 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 657 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 658 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 659 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 660 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 661 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 662 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 663 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 664 | while true; do |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 665 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p) |
| 666 | # When we use a proxy, it will be listening on the same port we |
| 667 | # are checking for as well as the server and lsof will list both. |
| 668 | # If multiple PIDs are returned, each one will be on a separate |
| 669 | # line, each prepended with 'p'. |
| 670 | case ${newline}${SERVER_PIDS}${newline} in |
| 671 | *${newline}p${2}${newline}*) break;; |
| 672 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 673 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 674 | echo "$3 START TIMEOUT" |
| 675 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 676 | break |
| 677 | fi |
| 678 | # Linux and *BSD support decimal arguments to sleep. On other |
| 679 | # OSes this may be a tight loop. |
| 680 | sleep 0.1 2>/dev/null || true |
| 681 | done |
| 682 | } |
| 683 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 684 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 685 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 686 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 687 | } |
| 688 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 689 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 690 | # Wait for server process $2 to be listening on port $1. |
| 691 | wait_server_start() { |
| 692 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 693 | } |
| 694 | |
| 695 | # Wait for proxy process $2 to be listening on port $1. |
| 696 | wait_proxy_start() { |
| 697 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 698 | } |
| 699 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 700 | # 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] | 701 | # 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] | 702 | # acceptable bounds |
| 703 | check_server_hello_time() { |
| 704 | # 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] | 705 | 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] | 706 | # Get the Unix timestamp for now |
| 707 | CUR_TIME=$(date +'%s') |
| 708 | THRESHOLD_IN_SECS=300 |
| 709 | |
| 710 | # Check if the ServerHello time was printed |
| 711 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 712 | return 1 |
| 713 | fi |
| 714 | |
| 715 | # Check the time in ServerHello is within acceptable bounds |
| 716 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 717 | # The time in ServerHello is at least 5 minutes before now |
| 718 | return 1 |
| 719 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 720 | # 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] | 721 | return 1 |
| 722 | else |
| 723 | return 0 |
| 724 | fi |
| 725 | } |
| 726 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 727 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 728 | handshake_memory_get() { |
| 729 | OUTPUT_VARIABLE="$1" |
| 730 | OUTPUT_FILE="$2" |
| 731 | |
| 732 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 733 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 734 | |
| 735 | # Check if memory usage was read |
| 736 | if [ -z "$MEM_USAGE" ]; then |
| 737 | echo "Error: Can not read the value of handshake memory usage" |
| 738 | return 1 |
| 739 | else |
| 740 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 741 | return 0 |
| 742 | fi |
| 743 | } |
| 744 | |
| 745 | # Get handshake memory usage from server or client output and check if this value |
| 746 | # is not higher than the maximum given by the first argument |
| 747 | handshake_memory_check() { |
| 748 | MAX_MEMORY="$1" |
| 749 | OUTPUT_FILE="$2" |
| 750 | |
| 751 | # Get memory usage |
| 752 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 753 | return 1 |
| 754 | fi |
| 755 | |
| 756 | # Check if memory usage is below max value |
| 757 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 758 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 759 | "but should be below $MAX_MEMORY bytes" |
| 760 | return 1 |
| 761 | else |
| 762 | return 0 |
| 763 | fi |
| 764 | } |
| 765 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 766 | # wait for client to terminate and set CLI_EXIT |
| 767 | # must be called right after starting the client |
| 768 | wait_client_done() { |
| 769 | CLI_PID=$! |
| 770 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 771 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 772 | CLI_DELAY_FACTOR=1 |
| 773 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 774 | ( 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] | 775 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 776 | |
| 777 | wait $CLI_PID |
| 778 | CLI_EXIT=$? |
| 779 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 780 | kill $DOG_PID >/dev/null 2>&1 |
| 781 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 782 | |
| 783 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 784 | |
| 785 | sleep $SRV_DELAY_SECONDS |
| 786 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 787 | } |
| 788 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 789 | # check if the given command uses dtls and sets global variable DTLS |
| 790 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 791 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 792 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 793 | *) DTLS=0;; |
| 794 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 795 | } |
| 796 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 797 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 798 | is_gnutls() { |
| 799 | case "$1" in |
| 800 | *gnutls-cli*) |
| 801 | CMD_IS_GNUTLS=1 |
| 802 | ;; |
| 803 | *gnutls-serv*) |
| 804 | CMD_IS_GNUTLS=1 |
| 805 | ;; |
| 806 | *) |
| 807 | CMD_IS_GNUTLS=0 |
| 808 | ;; |
| 809 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 810 | } |
| 811 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 812 | # Compare file content |
| 813 | # Usage: find_in_both pattern file1 file2 |
| 814 | # extract from file1 the first line matching the pattern |
| 815 | # check in file2 that the same line can be found |
| 816 | find_in_both() { |
| 817 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 818 | if [ -z "$srv_pattern" ]; then |
| 819 | return 1; |
| 820 | fi |
| 821 | |
| 822 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 823 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 824 | else |
| 825 | return 1; |
| 826 | fi |
| 827 | } |
| 828 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 829 | SKIP_HANDSHAKE_CHECK="NO" |
| 830 | skip_handshake_stage_check() { |
| 831 | SKIP_HANDSHAKE_CHECK="YES" |
| 832 | } |
| 833 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 834 | # Analyze the commands that will be used in a test. |
| 835 | # |
| 836 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 837 | # extra arguments or go through wrappers. |
| 838 | # Set $DTLS (0=TLS, 1=DTLS). |
| 839 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 840 | # update DTLS variable |
| 841 | detect_dtls "$SRV_CMD" |
| 842 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 843 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 844 | # 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] | 845 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 846 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 847 | case " $SRV_CMD " in |
| 848 | *' server_addr=::1 '*) |
| 849 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 850 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 851 | fi |
| 852 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 853 | # update CMD_IS_GNUTLS variable |
| 854 | is_gnutls "$SRV_CMD" |
| 855 | |
| 856 | # if the server uses gnutls but doesn't set priority, explicitly |
| 857 | # set the default priority |
| 858 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 859 | case "$SRV_CMD" in |
| 860 | *--priority*) :;; |
| 861 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 862 | esac |
| 863 | fi |
| 864 | |
| 865 | # update CMD_IS_GNUTLS variable |
| 866 | is_gnutls "$CLI_CMD" |
| 867 | |
| 868 | # if the client uses gnutls but doesn't set priority, explicitly |
| 869 | # set the default priority |
| 870 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 871 | case "$CLI_CMD" in |
| 872 | *--priority*) :;; |
| 873 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 874 | esac |
| 875 | fi |
| 876 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 877 | # fix client port |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 878 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 879 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 880 | else |
| 881 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 882 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 883 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 884 | # prepend valgrind to our commands if active |
| 885 | if [ "$MEMCHECK" -gt 0 ]; then |
| 886 | if is_polar "$SRV_CMD"; then |
| 887 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 888 | fi |
| 889 | if is_polar "$CLI_CMD"; then |
| 890 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 891 | fi |
| 892 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 893 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 894 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 895 | # Check for failure conditions after a test case. |
| 896 | # |
| 897 | # Inputs from run_test: |
| 898 | # * positional parameters: test options (see run_test documentation) |
| 899 | # * $CLI_EXIT: client return code |
| 900 | # * $CLI_EXPECT: expected client return code |
| 901 | # * $SRV_RET: server return code |
| 902 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 903 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 904 | # |
| 905 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 906 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 907 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 908 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 909 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 910 | if [ $TIMES_LEFT -gt 0 ] && |
| 911 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 912 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 913 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 914 | return |
| 915 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 916 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 917 | # 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] | 918 | # (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] | 919 | # expected client exit to incorrectly succeed in case of catastrophic |
| 920 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 921 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 922 | then |
| 923 | if is_polar "$SRV_CMD"; then |
| 924 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 925 | else |
| 926 | fail "server or client failed to reach handshake stage" |
| 927 | return |
| 928 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 929 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 930 | if is_polar "$CLI_CMD"; then |
| 931 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 932 | else |
| 933 | fail "server or client failed to reach handshake stage" |
| 934 | return |
| 935 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 936 | fi |
| 937 | fi |
| 938 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 939 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 940 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 941 | # exit with status 0 when interrupted by a signal, and we don't really |
| 942 | # care anyway), in case e.g. the server reports a memory leak. |
| 943 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 944 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 945 | return |
| 946 | fi |
| 947 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 948 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 949 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 950 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 951 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 952 | 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] | 953 | return |
| 954 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 955 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 956 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 957 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 958 | # 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] | 959 | while [ $# -gt 0 ] |
| 960 | do |
| 961 | case $1 in |
| 962 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 963 | 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] | 964 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 965 | return |
| 966 | fi |
| 967 | ;; |
| 968 | |
| 969 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 970 | 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] | 971 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 972 | return |
| 973 | fi |
| 974 | ;; |
| 975 | |
| 976 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 977 | 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] | 978 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 979 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 980 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 981 | return |
| 982 | fi |
| 983 | ;; |
| 984 | |
| 985 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 986 | 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] | 987 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 988 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 989 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 990 | return |
| 991 | fi |
| 992 | ;; |
| 993 | |
| 994 | # The filtering in the following two options (-u and -U) do the following |
| 995 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 996 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 997 | # - keep one of each non-unique line |
| 998 | # - count how many lines remain |
| 999 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1000 | # if there were no duplicates. |
| 1001 | "-U") |
| 1002 | 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 |
| 1003 | fail "lines following pattern '$2' must be unique in Server output" |
| 1004 | return |
| 1005 | fi |
| 1006 | ;; |
| 1007 | |
| 1008 | "-u") |
| 1009 | 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 |
| 1010 | 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] | 1011 | return |
| 1012 | fi |
| 1013 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1014 | "-F") |
| 1015 | if ! $2 "$SRV_OUT"; then |
| 1016 | fail "function call to '$2' failed on Server output" |
| 1017 | return |
| 1018 | fi |
| 1019 | ;; |
| 1020 | "-f") |
| 1021 | if ! $2 "$CLI_OUT"; then |
| 1022 | fail "function call to '$2' failed on Client output" |
| 1023 | return |
| 1024 | fi |
| 1025 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1026 | "-g") |
| 1027 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1028 | fail "function call to '$2' failed on Server and Client output" |
| 1029 | return |
| 1030 | fi |
| 1031 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1032 | |
| 1033 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1034 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1035 | exit 1 |
| 1036 | esac |
| 1037 | shift 2 |
| 1038 | done |
| 1039 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1040 | # check valgrind's results |
| 1041 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1042 | 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] | 1043 | fail "Server has memory errors" |
| 1044 | return |
| 1045 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1046 | 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] | 1047 | fail "Client has memory errors" |
| 1048 | return |
| 1049 | fi |
| 1050 | fi |
| 1051 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1052 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1053 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1054 | } |
| 1055 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1056 | # Run the current test case: start the server and if applicable the proxy, run |
| 1057 | # the client, wait for all processes to finish or time out. |
| 1058 | # |
| 1059 | # Inputs: |
| 1060 | # * $NAME: test case name |
| 1061 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1062 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1063 | # |
| 1064 | # Outputs: |
| 1065 | # * $CLI_EXIT: client return code |
| 1066 | # * $SRV_RET: server return code |
| 1067 | do_run_test_once() { |
| 1068 | # run the commands |
| 1069 | if [ -n "$PXY_CMD" ]; then |
| 1070 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1071 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1072 | PXY_PID=$! |
| 1073 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1074 | fi |
| 1075 | |
| 1076 | check_osrv_dtls |
| 1077 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1078 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1079 | SRV_PID=$! |
| 1080 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1081 | |
| 1082 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1083 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1084 | wait_client_done |
| 1085 | |
| 1086 | sleep 0.05 |
| 1087 | |
| 1088 | # terminate the server (and the proxy) |
| 1089 | kill $SRV_PID |
| 1090 | wait $SRV_PID |
| 1091 | SRV_RET=$? |
| 1092 | |
| 1093 | if [ -n "$PXY_CMD" ]; then |
| 1094 | kill $PXY_PID >/dev/null 2>&1 |
| 1095 | wait $PXY_PID |
| 1096 | fi |
| 1097 | } |
| 1098 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1099 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1100 | # Options: -s pattern pattern that must be present in server output |
| 1101 | # -c pattern pattern that must be present in client output |
| 1102 | # -u pattern lines after pattern must be unique in client output |
| 1103 | # -f call shell function on client output |
| 1104 | # -S pattern pattern that must be absent in server output |
| 1105 | # -C pattern pattern that must be absent in client output |
| 1106 | # -U pattern lines after pattern must be unique in server output |
| 1107 | # -F call shell function on server output |
| 1108 | # -g call shell function on server and client output |
| 1109 | run_test() { |
| 1110 | NAME="$1" |
| 1111 | shift 1 |
| 1112 | |
| 1113 | if is_excluded "$NAME"; then |
| 1114 | SKIP_NEXT="NO" |
| 1115 | # There was no request to run the test, so don't record its outcome. |
| 1116 | return |
| 1117 | fi |
| 1118 | |
| 1119 | print_name "$NAME" |
| 1120 | |
| 1121 | # Do we only run numbered tests? |
| 1122 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1123 | case ",$RUN_TEST_NUMBER," in |
| 1124 | *",$TESTS,"*) :;; |
| 1125 | *) SKIP_NEXT="YES";; |
| 1126 | esac |
| 1127 | fi |
| 1128 | |
| 1129 | # does this test use a proxy? |
| 1130 | if [ "X$1" = "X-p" ]; then |
| 1131 | PXY_CMD="$2" |
| 1132 | shift 2 |
| 1133 | else |
| 1134 | PXY_CMD="" |
| 1135 | fi |
| 1136 | |
| 1137 | # get commands and client output |
| 1138 | SRV_CMD="$1" |
| 1139 | CLI_CMD="$2" |
| 1140 | CLI_EXPECT="$3" |
| 1141 | shift 3 |
| 1142 | |
| 1143 | # Check if test uses files |
| 1144 | case "$SRV_CMD $CLI_CMD" in |
| 1145 | *data_files/*) |
| 1146 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1147 | esac |
| 1148 | |
| 1149 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1150 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1151 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1152 | |
| 1153 | # should we skip? |
| 1154 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1155 | SKIP_NEXT="NO" |
| 1156 | record_outcome "SKIP" |
| 1157 | SKIPS=$(( $SKIPS + 1 )) |
| 1158 | return |
| 1159 | fi |
| 1160 | |
| 1161 | analyze_test_commands "$@" |
| 1162 | |
| 1163 | TIMES_LEFT=2 |
| 1164 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1165 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1166 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1167 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1168 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1169 | check_test_failure "$@" |
| 1170 | case $outcome in |
| 1171 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1172 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1173 | FAIL) return;; |
| 1174 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1175 | done |
| 1176 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1177 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1178 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1179 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1180 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1181 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1182 | if [ -n "$PXY_CMD" ]; then |
| 1183 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1184 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1185 | fi |
| 1186 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1187 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1188 | } |
| 1189 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1190 | run_test_psa() { |
| 1191 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1192 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 1193 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 1194 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1195 | 0 \ |
| 1196 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1197 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1198 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1199 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1200 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1201 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1202 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1203 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1204 | -C "Failed to setup PSA-based cipher context"\ |
| 1205 | -S "Failed to setup PSA-based cipher context"\ |
| 1206 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1207 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1208 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1209 | -S "error" \ |
| 1210 | -C "error" |
| 1211 | } |
| 1212 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1213 | run_test_psa_force_curve() { |
| 1214 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1215 | run_test "PSA - ECDH with $1" \ |
Gilles Peskine | 12b5b38 | 2021-06-02 10:00:42 +0200 | [diff] [blame] | 1216 | "$P_SRV debug_level=4 force_version=tls1_2 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1217 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 1218 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1219 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1220 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1221 | -c "PSA calc verify" \ |
| 1222 | -c "calc PSA finished" \ |
| 1223 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1224 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1225 | -s "PSA calc verify" \ |
| 1226 | -s "calc PSA finished" \ |
| 1227 | -C "Failed to setup PSA-based cipher context"\ |
| 1228 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1229 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1230 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1231 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1232 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1233 | -C "error" |
| 1234 | } |
| 1235 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1236 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1237 | # a maximum fragment length. |
| 1238 | # first argument ($1) is MFL for SSL client |
| 1239 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1240 | run_test_memory_after_hanshake_with_mfl() |
| 1241 | { |
| 1242 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1243 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1244 | |
| 1245 | # Leave some margin for robustness |
| 1246 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1247 | |
| 1248 | run_test "Handshake memory usage (MFL $1)" \ |
| 1249 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1250 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1251 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1252 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1253 | 0 \ |
| 1254 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1255 | } |
| 1256 | |
| 1257 | |
| 1258 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1259 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1260 | run_tests_memory_after_hanshake() |
| 1261 | { |
| 1262 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1263 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1264 | |
| 1265 | # first test with default MFU is to get reference memory usage |
| 1266 | MEMORY_USAGE_MFL_16K=0 |
| 1267 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1268 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1269 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1270 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1271 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1272 | 0 \ |
| 1273 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1274 | |
| 1275 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1276 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1277 | |
| 1278 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1279 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1280 | |
| 1281 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1282 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1283 | |
| 1284 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1285 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1286 | } |
| 1287 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1288 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1289 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1290 | rm -f context_srv.txt |
| 1291 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1292 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1293 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1294 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1295 | 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] | 1296 | exit 1 |
| 1297 | } |
| 1298 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1299 | # |
| 1300 | # MAIN |
| 1301 | # |
| 1302 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1303 | get_options "$@" |
| 1304 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1305 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1306 | # patterns rather than regular expressions, use a case statement instead |
| 1307 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1308 | # detects simple cases: plain substring, everything, nothing. |
| 1309 | # |
| 1310 | # As an exception, the character '.' is treated as an ordinary character |
| 1311 | # if it is the only special character in the string. This is because it's |
| 1312 | # rare to need "any one character", but needing a literal '.' is common |
| 1313 | # (e.g. '-f "DTLS 1.2"'). |
| 1314 | need_grep= |
| 1315 | case "$FILTER" in |
| 1316 | '^$') simple_filter=;; |
| 1317 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1318 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1319 | need_grep=1;; |
| 1320 | *) # No regexp or shell-pattern special character |
| 1321 | simple_filter="*$FILTER*";; |
| 1322 | esac |
| 1323 | case "$EXCLUDE" in |
| 1324 | '^$') simple_exclude=;; |
| 1325 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1326 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1327 | need_grep=1;; |
| 1328 | *) # No regexp or shell-pattern special character |
| 1329 | simple_exclude="*$EXCLUDE*";; |
| 1330 | esac |
| 1331 | if [ -n "$need_grep" ]; then |
| 1332 | is_excluded () { |
| 1333 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1334 | } |
| 1335 | else |
| 1336 | is_excluded () { |
| 1337 | case "$1" in |
| 1338 | $simple_exclude) true;; |
| 1339 | $simple_filter) false;; |
| 1340 | *) true;; |
| 1341 | esac |
| 1342 | } |
| 1343 | fi |
| 1344 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1345 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1346 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1347 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1348 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1349 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1350 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1351 | exit 1 |
| 1352 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1353 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1354 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1355 | exit 1 |
| 1356 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1357 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1358 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1359 | exit 1 |
| 1360 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1361 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1362 | if which valgrind >/dev/null 2>&1; then :; else |
| 1363 | echo "Memcheck not possible. Valgrind not found" |
| 1364 | exit 1 |
| 1365 | fi |
| 1366 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1367 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1368 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1369 | exit 1 |
| 1370 | fi |
| 1371 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1372 | # used by watchdog |
| 1373 | MAIN_PID="$$" |
| 1374 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1375 | # We use somewhat arbitrary delays for tests: |
| 1376 | # - how long do we wait for the server to start (when lsof not available)? |
| 1377 | # - how long do we allow for the client to finish? |
| 1378 | # (not to check performance, just to avoid waiting indefinitely) |
| 1379 | # Things are slower with valgrind, so give extra time here. |
| 1380 | # |
| 1381 | # Note: without lsof, there is a trade-off between the running time of this |
| 1382 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1383 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1384 | # 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] | 1385 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1386 | START_DELAY=6 |
| 1387 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1388 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1389 | START_DELAY=2 |
| 1390 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1391 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1392 | |
| 1393 | # some particular tests need more time: |
| 1394 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1395 | # - for the server, we sleep for a number of seconds after the client exits |
| 1396 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1397 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1398 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1399 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1400 | # 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] | 1401 | # +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] | 1402 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1403 | # 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] | 1404 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1405 | 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] | 1406 | 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] | 1407 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1408 | 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] | 1409 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1410 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1411 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1412 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1413 | 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] | 1414 | 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] | 1415 | fi |
| 1416 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1417 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1418 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1419 | 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] | 1420 | fi |
| 1421 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1422 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1423 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1424 | fi |
| 1425 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1426 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1427 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1428 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1429 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1430 | # Allow SHA-1, because many of our test certificates use it |
| 1431 | P_SRV="$P_SRV allow_sha1=1" |
| 1432 | P_CLI="$P_CLI allow_sha1=1" |
| 1433 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1434 | # Also pick a unique name for intermediate files |
| 1435 | SRV_OUT="srv_out.$$" |
| 1436 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1437 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1438 | SESSION="session.$$" |
| 1439 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1440 | SKIP_NEXT="NO" |
| 1441 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1442 | trap cleanup INT TERM HUP |
| 1443 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1444 | # Basic test |
| 1445 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1446 | # Checks that: |
| 1447 | # - 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] | 1448 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1449 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1450 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1451 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1452 | "$P_CLI" \ |
| 1453 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1454 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1455 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1456 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1457 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1458 | -S "error" \ |
| 1459 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1460 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1461 | run_test "Default, DTLS" \ |
| 1462 | "$P_SRV dtls=1" \ |
| 1463 | "$P_CLI dtls=1" \ |
| 1464 | 0 \ |
| 1465 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1466 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1467 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1468 | run_test "TLS client auth: required" \ |
| 1469 | "$P_SRV auth_mode=required" \ |
| 1470 | "$P_CLI" \ |
| 1471 | 0 \ |
| 1472 | -s "Verifying peer X.509 certificate... ok" |
| 1473 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1474 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1475 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1476 | requires_config_enabled MBEDTLS_SHA256_C |
| 1477 | run_test "TLS: password protected client key" \ |
| 1478 | "$P_SRV auth_mode=required" \ |
| 1479 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1480 | 0 |
| 1481 | |
| 1482 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1483 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1484 | requires_config_enabled MBEDTLS_SHA256_C |
| 1485 | run_test "TLS: password protected server key" \ |
| 1486 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1487 | "$P_CLI" \ |
| 1488 | 0 |
| 1489 | |
| 1490 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1491 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1492 | requires_config_enabled MBEDTLS_RSA_C |
| 1493 | requires_config_enabled MBEDTLS_SHA256_C |
| 1494 | run_test "TLS: password protected server key, two certificates" \ |
| 1495 | "$P_SRV \ |
| 1496 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1497 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1498 | "$P_CLI" \ |
| 1499 | 0 |
| 1500 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1501 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1502 | run_test "CA callback on client" \ |
| 1503 | "$P_SRV debug_level=3" \ |
| 1504 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1505 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1506 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1507 | -S "error" \ |
| 1508 | -C "error" |
| 1509 | |
| 1510 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1511 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1512 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1513 | requires_config_enabled MBEDTLS_SHA256_C |
| 1514 | run_test "CA callback on server" \ |
| 1515 | "$P_SRV auth_mode=required" \ |
| 1516 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1517 | key_file=data_files/server5.key" \ |
| 1518 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1519 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1520 | -s "Verifying peer X.509 certificate... ok" \ |
| 1521 | -S "error" \ |
| 1522 | -C "error" |
| 1523 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1524 | # Test using an opaque private key for client authentication |
| 1525 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1526 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1527 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1528 | requires_config_enabled MBEDTLS_SHA256_C |
| 1529 | run_test "Opaque key for client authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1530 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1531 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1532 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1533 | key_file=data_files/server5.key" \ |
| 1534 | 0 \ |
| 1535 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1536 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1537 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1538 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1539 | -S "error" \ |
| 1540 | -C "error" |
| 1541 | |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1542 | # Test using an opaque private key for server authentication |
| 1543 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1544 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1545 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1546 | requires_config_enabled MBEDTLS_SHA256_C |
| 1547 | run_test "Opaque key for server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1548 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1549 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1550 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1551 | key_file=data_files/server5.key" \ |
| 1552 | 0 \ |
| 1553 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1554 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 1555 | -s "key types: Opaque - invalid PK" \ |
| 1556 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1557 | -S "error" \ |
| 1558 | -C "error" |
| 1559 | |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1560 | # Test using an opaque private key for client/server authentication |
| 1561 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1562 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1563 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1564 | requires_config_enabled MBEDTLS_SHA256_C |
| 1565 | run_test "Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1566 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1567 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1568 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1569 | key_file=data_files/server5.key" \ |
| 1570 | 0 \ |
| 1571 | -c "key type: Opaque" \ |
| 1572 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1573 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 1574 | -s "key types: Opaque - invalid PK" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1575 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1576 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1577 | -S "error" \ |
| 1578 | -C "error" |
| 1579 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1580 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1581 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1582 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1583 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1584 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1585 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1586 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1587 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1588 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1589 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1590 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1591 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1592 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1593 | run_test_psa_force_curve "secp521r1" |
| 1594 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1595 | run_test_psa_force_curve "brainpoolP512r1" |
| 1596 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1597 | run_test_psa_force_curve "secp384r1" |
| 1598 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1599 | run_test_psa_force_curve "brainpoolP384r1" |
| 1600 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1601 | run_test_psa_force_curve "secp256r1" |
| 1602 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1603 | run_test_psa_force_curve "secp256k1" |
| 1604 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1605 | run_test_psa_force_curve "brainpoolP256r1" |
| 1606 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1607 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1608 | ## SECP224K1 is buggy via the PSA API |
| 1609 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1610 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1611 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1612 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1613 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1614 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1615 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1616 | run_test_psa_force_curve "secp192r1" |
| 1617 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1618 | run_test_psa_force_curve "secp192k1" |
| 1619 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1620 | # Test current time in ServerHello |
| 1621 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1622 | run_test "ServerHello contains gmt_unix_time" \ |
| 1623 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1624 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1625 | 0 \ |
| 1626 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1627 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1628 | |
| 1629 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1630 | run_test "Unique IV in GCM" \ |
| 1631 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1632 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1633 | 0 \ |
| 1634 | -u "IV used" \ |
| 1635 | -U "IV used" |
| 1636 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1637 | # Tests for certificate verification callback |
| 1638 | run_test "Configuration-specific CRT verification callback" \ |
| 1639 | "$P_SRV debug_level=3" \ |
| 1640 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1641 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1642 | -S "error" \ |
| 1643 | -c "Verify requested for " \ |
| 1644 | -c "Use configuration-specific verification callback" \ |
| 1645 | -C "Use context-specific verification callback" \ |
| 1646 | -C "error" |
| 1647 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1648 | run_test "Context-specific CRT verification callback" \ |
| 1649 | "$P_SRV debug_level=3" \ |
| 1650 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1651 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1652 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1653 | -c "Verify requested for " \ |
| 1654 | -c "Use context-specific verification callback" \ |
| 1655 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1656 | -C "error" |
| 1657 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1658 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1659 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1660 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1661 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1662 | 1 \ |
| 1663 | -c "The certificate is signed with an unacceptable hash" |
| 1664 | |
| 1665 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1666 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1667 | "$P_CLI allow_sha1=1" \ |
| 1668 | 0 |
| 1669 | |
| 1670 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1671 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1672 | "$P_CLI allow_sha1=0" \ |
| 1673 | 0 |
| 1674 | |
| 1675 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1676 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1677 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1678 | 1 \ |
| 1679 | -s "The certificate is signed with an unacceptable hash" |
| 1680 | |
| 1681 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1682 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1683 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1684 | 0 |
| 1685 | |
| 1686 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1687 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1688 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1689 | 0 |
| 1690 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1691 | # Dummy TLS 1.3 test |
| 1692 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1693 | # ssl_client2/ssl_server2 example programs works. |
| 1694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1695 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1696 | "$P_SRV tls13_kex_modes=psk" \ |
| 1697 | "$P_CLI tls13_kex_modes=psk" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1698 | 0 |
| 1699 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1700 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1701 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1702 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1703 | 0 |
| 1704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1705 | 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] | 1706 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1707 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1708 | 0 |
| 1709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1710 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1711 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1712 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1713 | 0 |
| 1714 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1715 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1716 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1717 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1718 | 0 |
| 1719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1720 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1721 | "$P_SRV tls13_kex_modes=all" \ |
| 1722 | "$P_CLI tls13_kex_modes=all" \ |
| 1723 | 0 |
| 1724 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1725 | # Tests for datagram packing |
| 1726 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1727 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1728 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1729 | 0 \ |
| 1730 | -c "next record in same datagram" \ |
| 1731 | -s "next record in same datagram" |
| 1732 | |
| 1733 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1734 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1735 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1736 | 0 \ |
| 1737 | -s "next record in same datagram" \ |
| 1738 | -C "next record in same datagram" |
| 1739 | |
| 1740 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1741 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1742 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1743 | 0 \ |
| 1744 | -S "next record in same datagram" \ |
| 1745 | -c "next record in same datagram" |
| 1746 | |
| 1747 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1748 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1749 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1750 | 0 \ |
| 1751 | -S "next record in same datagram" \ |
| 1752 | -C "next record in same datagram" |
| 1753 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1754 | # Tests for Context serialization |
| 1755 | |
| 1756 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1757 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1758 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1759 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1760 | 0 \ |
| 1761 | -c "Deserializing connection..." \ |
| 1762 | -S "Deserializing connection..." |
| 1763 | |
| 1764 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1765 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1766 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1767 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1768 | 0 \ |
| 1769 | -c "Deserializing connection..." \ |
| 1770 | -S "Deserializing connection..." |
| 1771 | |
| 1772 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1773 | run_test "Context serialization, client serializes, GCM" \ |
| 1774 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1775 | "$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] | 1776 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1777 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1778 | -S "Deserializing connection..." |
| 1779 | |
| 1780 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1781 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1782 | run_test "Context serialization, client serializes, with CID" \ |
| 1783 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1784 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1785 | 0 \ |
| 1786 | -c "Deserializing connection..." \ |
| 1787 | -S "Deserializing connection..." |
| 1788 | |
| 1789 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1790 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1791 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1792 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1793 | 0 \ |
| 1794 | -C "Deserializing connection..." \ |
| 1795 | -s "Deserializing connection..." |
| 1796 | |
| 1797 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1798 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1799 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1800 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1801 | 0 \ |
| 1802 | -C "Deserializing connection..." \ |
| 1803 | -s "Deserializing connection..." |
| 1804 | |
| 1805 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1806 | run_test "Context serialization, server serializes, GCM" \ |
| 1807 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1808 | "$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] | 1809 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1810 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1811 | -s "Deserializing connection..." |
| 1812 | |
| 1813 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1814 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1815 | run_test "Context serialization, server serializes, with CID" \ |
| 1816 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1817 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1818 | 0 \ |
| 1819 | -C "Deserializing connection..." \ |
| 1820 | -s "Deserializing connection..." |
| 1821 | |
| 1822 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1823 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1824 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1825 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1826 | 0 \ |
| 1827 | -c "Deserializing connection..." \ |
| 1828 | -s "Deserializing connection..." |
| 1829 | |
| 1830 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1831 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1832 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1833 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1834 | 0 \ |
| 1835 | -c "Deserializing connection..." \ |
| 1836 | -s "Deserializing connection..." |
| 1837 | |
| 1838 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1839 | run_test "Context serialization, both serialize, GCM" \ |
| 1840 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1841 | "$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] | 1842 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1843 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1844 | -s "Deserializing connection..." |
| 1845 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1846 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1847 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1848 | run_test "Context serialization, both serialize, with CID" \ |
| 1849 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1850 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1851 | 0 \ |
| 1852 | -c "Deserializing connection..." \ |
| 1853 | -s "Deserializing connection..." |
| 1854 | |
| 1855 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1856 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1857 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1858 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1859 | 0 \ |
| 1860 | -c "Deserializing connection..." \ |
| 1861 | -S "Deserializing connection..." |
| 1862 | |
| 1863 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1864 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1865 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1866 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1867 | 0 \ |
| 1868 | -c "Deserializing connection..." \ |
| 1869 | -S "Deserializing connection..." |
| 1870 | |
| 1871 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1872 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1873 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1874 | "$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] | 1875 | 0 \ |
| 1876 | -c "Deserializing connection..." \ |
| 1877 | -S "Deserializing connection..." |
| 1878 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1879 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1880 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1881 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1882 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1883 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1884 | 0 \ |
| 1885 | -c "Deserializing connection..." \ |
| 1886 | -S "Deserializing connection..." |
| 1887 | |
| 1888 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1889 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1890 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1891 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1892 | 0 \ |
| 1893 | -C "Deserializing connection..." \ |
| 1894 | -s "Deserializing connection..." |
| 1895 | |
| 1896 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1897 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1898 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1899 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1900 | 0 \ |
| 1901 | -C "Deserializing connection..." \ |
| 1902 | -s "Deserializing connection..." |
| 1903 | |
| 1904 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1905 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1906 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1907 | "$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] | 1908 | 0 \ |
| 1909 | -C "Deserializing connection..." \ |
| 1910 | -s "Deserializing connection..." |
| 1911 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1912 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1913 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1914 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1915 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1916 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1917 | 0 \ |
| 1918 | -C "Deserializing connection..." \ |
| 1919 | -s "Deserializing connection..." |
| 1920 | |
| 1921 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1922 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1923 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1924 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1925 | 0 \ |
| 1926 | -c "Deserializing connection..." \ |
| 1927 | -s "Deserializing connection..." |
| 1928 | |
| 1929 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1930 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1931 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1932 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1933 | 0 \ |
| 1934 | -c "Deserializing connection..." \ |
| 1935 | -s "Deserializing connection..." |
| 1936 | |
| 1937 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1938 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1939 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1940 | "$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] | 1941 | 0 \ |
| 1942 | -c "Deserializing connection..." \ |
| 1943 | -s "Deserializing connection..." |
| 1944 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1945 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1946 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1947 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1948 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1949 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1950 | 0 \ |
| 1951 | -c "Deserializing connection..." \ |
| 1952 | -s "Deserializing connection..." |
| 1953 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1954 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1955 | run_test "Saving the serialized context to a file" \ |
| 1956 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1957 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1958 | 0 \ |
| 1959 | -s "Save serialized context to a file... ok" \ |
| 1960 | -c "Save serialized context to a file... ok" |
| 1961 | rm -f context_srv.txt |
| 1962 | rm -f context_cli.txt |
| 1963 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1964 | # Tests for DTLS Connection ID extension |
| 1965 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1966 | # So far, the CID API isn't implemented, so we can't |
| 1967 | # grep for output witnessing its use. This needs to be |
| 1968 | # changed once the CID extension is implemented. |
| 1969 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1970 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1971 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1972 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1973 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1974 | 0 \ |
| 1975 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1976 | -s "found CID extension" \ |
| 1977 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1978 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1979 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1980 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1981 | -C "found CID extension" \ |
| 1982 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1983 | -C "Copy CIDs into SSL transform" \ |
| 1984 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1985 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1986 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1987 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1988 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1989 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1990 | 0 \ |
| 1991 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1992 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1993 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1994 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1995 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1996 | -C "found CID extension" \ |
| 1997 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1998 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1999 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2000 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2001 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2002 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2003 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2004 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2005 | 0 \ |
| 2006 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2007 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2008 | -c "client hello, adding CID extension" \ |
| 2009 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2010 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2011 | -s "server hello, adding CID extension" \ |
| 2012 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2013 | -c "Use of CID extension negotiated" \ |
| 2014 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2015 | -c "Copy CIDs into SSL transform" \ |
| 2016 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2017 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2018 | -s "Use of Connection ID has been negotiated" \ |
| 2019 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2020 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2021 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2022 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2023 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2024 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2025 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2026 | 0 \ |
| 2027 | -c "Enable use of CID extension." \ |
| 2028 | -s "Enable use of CID extension." \ |
| 2029 | -c "client hello, adding CID extension" \ |
| 2030 | -s "found CID extension" \ |
| 2031 | -s "Use of CID extension negotiated" \ |
| 2032 | -s "server hello, adding CID extension" \ |
| 2033 | -c "found CID extension" \ |
| 2034 | -c "Use of CID extension negotiated" \ |
| 2035 | -s "Copy CIDs into SSL transform" \ |
| 2036 | -c "Copy CIDs into SSL transform" \ |
| 2037 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2038 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2039 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2040 | -c "Use of Connection ID has been negotiated" \ |
| 2041 | -c "ignoring unexpected CID" \ |
| 2042 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2043 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2044 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2045 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2046 | -p "$P_PXY mtu=800" \ |
| 2047 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2048 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2049 | 0 \ |
| 2050 | -c "Enable use of CID extension." \ |
| 2051 | -s "Enable use of CID extension." \ |
| 2052 | -c "client hello, adding CID extension" \ |
| 2053 | -s "found CID extension" \ |
| 2054 | -s "Use of CID extension negotiated" \ |
| 2055 | -s "server hello, adding CID extension" \ |
| 2056 | -c "found CID extension" \ |
| 2057 | -c "Use of CID extension negotiated" \ |
| 2058 | -s "Copy CIDs into SSL transform" \ |
| 2059 | -c "Copy CIDs into SSL transform" \ |
| 2060 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2061 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2062 | -s "Use of Connection ID has been negotiated" \ |
| 2063 | -c "Use of Connection ID has been negotiated" |
| 2064 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2065 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2066 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2067 | -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] | 2068 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2069 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2070 | 0 \ |
| 2071 | -c "Enable use of CID extension." \ |
| 2072 | -s "Enable use of CID extension." \ |
| 2073 | -c "client hello, adding CID extension" \ |
| 2074 | -s "found CID extension" \ |
| 2075 | -s "Use of CID extension negotiated" \ |
| 2076 | -s "server hello, adding CID extension" \ |
| 2077 | -c "found CID extension" \ |
| 2078 | -c "Use of CID extension negotiated" \ |
| 2079 | -s "Copy CIDs into SSL transform" \ |
| 2080 | -c "Copy CIDs into SSL transform" \ |
| 2081 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2082 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2083 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2084 | -c "Use of Connection ID has been negotiated" \ |
| 2085 | -c "ignoring unexpected CID" \ |
| 2086 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2087 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2088 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2089 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2090 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2091 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2092 | 0 \ |
| 2093 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2094 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2095 | -c "client hello, adding CID extension" \ |
| 2096 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2097 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2098 | -s "server hello, adding CID extension" \ |
| 2099 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2100 | -c "Use of CID extension negotiated" \ |
| 2101 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2102 | -c "Copy CIDs into SSL transform" \ |
| 2103 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2104 | -s "Peer CID (length 0 Bytes):" \ |
| 2105 | -s "Use of Connection ID has been negotiated" \ |
| 2106 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2107 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2108 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2109 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2110 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2111 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2112 | 0 \ |
| 2113 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2114 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2115 | -c "client hello, adding CID extension" \ |
| 2116 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2117 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2118 | -s "server hello, adding CID extension" \ |
| 2119 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2120 | -c "Use of CID extension negotiated" \ |
| 2121 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2122 | -c "Copy CIDs into SSL transform" \ |
| 2123 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2124 | -c "Peer CID (length 0 Bytes):" \ |
| 2125 | -s "Use of Connection ID has been negotiated" \ |
| 2126 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2127 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2128 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2129 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2130 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2131 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2132 | 0 \ |
| 2133 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2134 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2135 | -c "client hello, adding CID extension" \ |
| 2136 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2137 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2138 | -s "server hello, adding CID extension" \ |
| 2139 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2140 | -c "Use of CID extension negotiated" \ |
| 2141 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2142 | -c "Copy CIDs into SSL transform" \ |
| 2143 | -S "Use of Connection ID has been negotiated" \ |
| 2144 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2145 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2146 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2147 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2148 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2149 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2150 | 0 \ |
| 2151 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2152 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2153 | -c "client hello, adding CID extension" \ |
| 2154 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2155 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2156 | -s "server hello, adding CID extension" \ |
| 2157 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2158 | -c "Use of CID extension negotiated" \ |
| 2159 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2160 | -c "Copy CIDs into SSL transform" \ |
| 2161 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2162 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2163 | -s "Use of Connection ID has been negotiated" \ |
| 2164 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2165 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2166 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2167 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2168 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2169 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2170 | 0 \ |
| 2171 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2172 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2173 | -c "client hello, adding CID extension" \ |
| 2174 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2175 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2176 | -s "server hello, adding CID extension" \ |
| 2177 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2178 | -c "Use of CID extension negotiated" \ |
| 2179 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2180 | -c "Copy CIDs into SSL transform" \ |
| 2181 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2182 | -s "Peer CID (length 0 Bytes):" \ |
| 2183 | -s "Use of Connection ID has been negotiated" \ |
| 2184 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2185 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2186 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2187 | 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] | 2188 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2189 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2190 | 0 \ |
| 2191 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2192 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2193 | -c "client hello, adding CID extension" \ |
| 2194 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2195 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2196 | -s "server hello, adding CID extension" \ |
| 2197 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2198 | -c "Use of CID extension negotiated" \ |
| 2199 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2200 | -c "Copy CIDs into SSL transform" \ |
| 2201 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2202 | -c "Peer CID (length 0 Bytes):" \ |
| 2203 | -s "Use of Connection ID has been negotiated" \ |
| 2204 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2205 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2206 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2207 | 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] | 2208 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2209 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2210 | 0 \ |
| 2211 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2212 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2213 | -c "client hello, adding CID extension" \ |
| 2214 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2215 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2216 | -s "server hello, adding CID extension" \ |
| 2217 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2218 | -c "Use of CID extension negotiated" \ |
| 2219 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2220 | -c "Copy CIDs into SSL transform" \ |
| 2221 | -S "Use of Connection ID has been negotiated" \ |
| 2222 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2223 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2224 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2225 | 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] | 2226 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2227 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2228 | 0 \ |
| 2229 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2230 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2231 | -c "client hello, adding CID extension" \ |
| 2232 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2233 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2234 | -s "server hello, adding CID extension" \ |
| 2235 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2236 | -c "Use of CID extension negotiated" \ |
| 2237 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2238 | -c "Copy CIDs into SSL transform" \ |
| 2239 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2240 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2241 | -s "Use of Connection ID has been negotiated" \ |
| 2242 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2243 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2244 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2245 | 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] | 2246 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2247 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2248 | 0 \ |
| 2249 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2250 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2251 | -c "client hello, adding CID extension" \ |
| 2252 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2253 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2254 | -s "server hello, adding CID extension" \ |
| 2255 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2256 | -c "Use of CID extension negotiated" \ |
| 2257 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2258 | -c "Copy CIDs into SSL transform" \ |
| 2259 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2260 | -s "Peer CID (length 0 Bytes):" \ |
| 2261 | -s "Use of Connection ID has been negotiated" \ |
| 2262 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2263 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2264 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2265 | 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] | 2266 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2267 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2268 | 0 \ |
| 2269 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2270 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2271 | -c "client hello, adding CID extension" \ |
| 2272 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2273 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2274 | -s "server hello, adding CID extension" \ |
| 2275 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2276 | -c "Use of CID extension negotiated" \ |
| 2277 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2278 | -c "Copy CIDs into SSL transform" \ |
| 2279 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2280 | -c "Peer CID (length 0 Bytes):" \ |
| 2281 | -s "Use of Connection ID has been negotiated" \ |
| 2282 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2283 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2284 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2285 | 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] | 2286 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2287 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2288 | 0 \ |
| 2289 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2290 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2291 | -c "client hello, adding CID extension" \ |
| 2292 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2293 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2294 | -s "server hello, adding CID extension" \ |
| 2295 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2296 | -c "Use of CID extension negotiated" \ |
| 2297 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2298 | -c "Copy CIDs into SSL transform" \ |
| 2299 | -S "Use of Connection ID has been negotiated" \ |
| 2300 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2301 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2302 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2303 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2304 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2305 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2306 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2307 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2308 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2309 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2310 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2311 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2312 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2313 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2314 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2315 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2316 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2317 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2318 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2319 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2320 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2321 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2322 | 0 \ |
| 2323 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2324 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2325 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2326 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2327 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2328 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2329 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2330 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2331 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2332 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2333 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2334 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2335 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2336 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2337 | 0 \ |
| 2338 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2339 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2340 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2341 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2342 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2343 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2344 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2345 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2346 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2347 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2348 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2349 | 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] | 2350 | -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] | 2351 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2352 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2353 | 0 \ |
| 2354 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2355 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2356 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2357 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2358 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2359 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2360 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2361 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2362 | -c "ignoring unexpected CID" \ |
| 2363 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2364 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2365 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2366 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2367 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2368 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2369 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2370 | 0 \ |
| 2371 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2372 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2373 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2374 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2375 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2376 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2377 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2378 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2379 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2380 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2381 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2382 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2383 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2384 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2385 | 0 \ |
| 2386 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2387 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2388 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2389 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2390 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2391 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2392 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2393 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2394 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2395 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2396 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2397 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2398 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2399 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2400 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2401 | 0 \ |
| 2402 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2403 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2404 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2405 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2406 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2407 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2408 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2409 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2410 | -c "ignoring unexpected CID" \ |
| 2411 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2412 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2413 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2414 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2415 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2416 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2417 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2418 | 0 \ |
| 2419 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2420 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2421 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2422 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2423 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2424 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2425 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2426 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2427 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2428 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2429 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2430 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2431 | 0 \ |
| 2432 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2433 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2434 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2435 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2436 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2437 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2438 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2439 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2440 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2441 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2442 | -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] | 2443 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2444 | "$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" \ |
| 2445 | 0 \ |
| 2446 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2447 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2448 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2449 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2450 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2451 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2452 | -c "ignoring unexpected CID" \ |
| 2453 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 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: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2458 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2459 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2460 | 0 \ |
| 2461 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2462 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2463 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2464 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2465 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2466 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2467 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2468 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2469 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2470 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2471 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2472 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2473 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2474 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2475 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2476 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2477 | 0 \ |
| 2478 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2479 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2480 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2481 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2482 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2483 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2484 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2485 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2486 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2487 | -c "ignoring unexpected CID" \ |
| 2488 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2489 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2490 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2491 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2492 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2493 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2494 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2495 | 0 \ |
| 2496 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2497 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2498 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2499 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2500 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2501 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2502 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2503 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2504 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2505 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2506 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2507 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2508 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2509 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2510 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2511 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2512 | 0 \ |
| 2513 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2514 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2515 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2516 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2517 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2518 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2519 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2520 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2521 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2522 | -c "ignoring unexpected CID" \ |
| 2523 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2524 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2525 | # 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] | 2526 | # tests check that the buffer contents are reallocated when the message is |
| 2527 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2528 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2529 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2530 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2531 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2532 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2533 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2534 | 0 \ |
| 2535 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2536 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2537 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2538 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2539 | -s "Reallocating in_buf" \ |
| 2540 | -s "Reallocating out_buf" |
| 2541 | |
| 2542 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2543 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2544 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2545 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2546 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2547 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2548 | 0 \ |
| 2549 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2550 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2551 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2552 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2553 | -s "Reallocating in_buf" \ |
| 2554 | -s "Reallocating out_buf" |
| 2555 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2556 | # Tests for Encrypt-then-MAC extension |
| 2557 | |
| 2558 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2559 | "$P_SRV debug_level=3 \ |
| 2560 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2561 | "$P_CLI debug_level=3" \ |
| 2562 | 0 \ |
| 2563 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2564 | -s "found encrypt then mac extension" \ |
| 2565 | -s "server hello, adding encrypt then mac extension" \ |
| 2566 | -c "found encrypt_then_mac extension" \ |
| 2567 | -c "using encrypt then mac" \ |
| 2568 | -s "using encrypt then mac" |
| 2569 | |
| 2570 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2571 | "$P_SRV debug_level=3 etm=0 \ |
| 2572 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2573 | "$P_CLI debug_level=3 etm=1" \ |
| 2574 | 0 \ |
| 2575 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2576 | -s "found encrypt then mac extension" \ |
| 2577 | -S "server hello, adding encrypt then mac extension" \ |
| 2578 | -C "found encrypt_then_mac extension" \ |
| 2579 | -C "using encrypt then mac" \ |
| 2580 | -S "using encrypt then mac" |
| 2581 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2582 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2583 | "$P_SRV debug_level=3 etm=1 \ |
| 2584 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2585 | "$P_CLI debug_level=3 etm=1" \ |
| 2586 | 0 \ |
| 2587 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2588 | -s "found encrypt then mac extension" \ |
| 2589 | -S "server hello, adding encrypt then mac extension" \ |
| 2590 | -C "found encrypt_then_mac extension" \ |
| 2591 | -C "using encrypt then mac" \ |
| 2592 | -S "using encrypt then mac" |
| 2593 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2594 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2595 | "$P_SRV debug_level=3 etm=1 \ |
| 2596 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2597 | "$P_CLI debug_level=3 etm=0" \ |
| 2598 | 0 \ |
| 2599 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2600 | -S "found encrypt then mac extension" \ |
| 2601 | -S "server hello, adding encrypt then mac extension" \ |
| 2602 | -C "found encrypt_then_mac extension" \ |
| 2603 | -C "using encrypt then mac" \ |
| 2604 | -S "using encrypt then mac" |
| 2605 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2606 | # Tests for Extended Master Secret extension |
| 2607 | |
| 2608 | run_test "Extended Master Secret: default" \ |
| 2609 | "$P_SRV debug_level=3" \ |
| 2610 | "$P_CLI debug_level=3" \ |
| 2611 | 0 \ |
| 2612 | -c "client hello, adding extended_master_secret extension" \ |
| 2613 | -s "found extended master secret extension" \ |
| 2614 | -s "server hello, adding extended master secret extension" \ |
| 2615 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2616 | -c "session hash for extended master secret" \ |
| 2617 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2618 | |
| 2619 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2620 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2621 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2622 | 0 \ |
| 2623 | -c "client hello, adding extended_master_secret extension" \ |
| 2624 | -s "found extended master secret extension" \ |
| 2625 | -S "server hello, adding extended master secret extension" \ |
| 2626 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2627 | -C "session hash for extended master secret" \ |
| 2628 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2629 | |
| 2630 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2631 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2632 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2633 | 0 \ |
| 2634 | -C "client hello, adding extended_master_secret extension" \ |
| 2635 | -S "found extended master secret extension" \ |
| 2636 | -S "server hello, adding extended master secret extension" \ |
| 2637 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2638 | -C "session hash for extended master secret" \ |
| 2639 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2640 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2641 | # Test sending and receiving empty application data records |
| 2642 | |
| 2643 | run_test "Encrypt then MAC: empty application data record" \ |
| 2644 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2645 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2646 | 0 \ |
| 2647 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2648 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2649 | -c "0 bytes written in 1 fragments" |
| 2650 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2651 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2652 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2653 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2654 | 0 \ |
| 2655 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2656 | -c "0 bytes written in 1 fragments" |
| 2657 | |
| 2658 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2659 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2660 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2661 | 0 \ |
| 2662 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2663 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2664 | -c "0 bytes written in 1 fragments" |
| 2665 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2666 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2667 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2668 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2669 | 0 \ |
| 2670 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2671 | -c "0 bytes written in 1 fragments" |
| 2672 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2673 | # Tests for CBC 1/n-1 record splitting |
| 2674 | |
| 2675 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2676 | "$P_SRV" \ |
| 2677 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2678 | request_size=123 force_version=tls1_2" \ |
| 2679 | 0 \ |
| 2680 | -s "Read from client: 123 bytes read" \ |
| 2681 | -S "Read from client: 1 bytes read" \ |
| 2682 | -S "122 bytes read" |
| 2683 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2684 | # Tests for Session Tickets |
| 2685 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2686 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2687 | "$P_SRV debug_level=3 tickets=1" \ |
| 2688 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2689 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2690 | -c "client hello, adding session ticket extension" \ |
| 2691 | -s "found session ticket extension" \ |
| 2692 | -s "server hello, adding session ticket extension" \ |
| 2693 | -c "found session_ticket extension" \ |
| 2694 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2695 | -S "session successfully restored from cache" \ |
| 2696 | -s "session successfully restored from ticket" \ |
| 2697 | -s "a session has been resumed" \ |
| 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: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2701 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2702 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2703 | 0 \ |
| 2704 | -c "client hello, adding session ticket extension" \ |
| 2705 | -s "found session ticket extension" \ |
| 2706 | -s "server hello, adding session ticket extension" \ |
| 2707 | -c "found session_ticket extension" \ |
| 2708 | -c "parse new session ticket" \ |
| 2709 | -S "session successfully restored from cache" \ |
| 2710 | -s "session successfully restored from ticket" \ |
| 2711 | -s "a session has been resumed" \ |
| 2712 | -c "a session has been resumed" |
| 2713 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2714 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2715 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2716 | "$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] | 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 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2728 | run_test "Session resume using tickets: session copy" \ |
| 2729 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2730 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 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 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2742 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2743 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2744 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2745 | 0 \ |
| 2746 | -c "client hello, adding session ticket extension" \ |
| 2747 | -c "found session_ticket extension" \ |
| 2748 | -c "parse new session ticket" \ |
| 2749 | -c "a session has been resumed" |
| 2750 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2751 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2752 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2753 | "( $O_CLI -sess_out $SESSION; \ |
| 2754 | $O_CLI -sess_in $SESSION; \ |
| 2755 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2756 | 0 \ |
| 2757 | -s "found session ticket extension" \ |
| 2758 | -s "server hello, adding session ticket extension" \ |
| 2759 | -S "session successfully restored from cache" \ |
| 2760 | -s "session successfully restored from ticket" \ |
| 2761 | -s "a session has been resumed" |
| 2762 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2763 | # Tests for Session Tickets with DTLS |
| 2764 | |
| 2765 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2766 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2767 | "$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] | 2768 | 0 \ |
| 2769 | -c "client hello, adding session ticket extension" \ |
| 2770 | -s "found session ticket extension" \ |
| 2771 | -s "server hello, adding session ticket extension" \ |
| 2772 | -c "found session_ticket extension" \ |
| 2773 | -c "parse new session ticket" \ |
| 2774 | -S "session successfully restored from cache" \ |
| 2775 | -s "session successfully restored from ticket" \ |
| 2776 | -s "a session has been resumed" \ |
| 2777 | -c "a session has been resumed" |
| 2778 | |
| 2779 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2780 | "$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] | 2781 | "$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] | 2782 | 0 \ |
| 2783 | -c "client hello, adding session ticket extension" \ |
| 2784 | -s "found session ticket extension" \ |
| 2785 | -s "server hello, adding session ticket extension" \ |
| 2786 | -c "found session_ticket extension" \ |
| 2787 | -c "parse new session ticket" \ |
| 2788 | -S "session successfully restored from cache" \ |
| 2789 | -s "session successfully restored from ticket" \ |
| 2790 | -s "a session has been resumed" \ |
| 2791 | -c "a session has been resumed" |
| 2792 | |
| 2793 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2794 | "$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] | 2795 | "$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] | 2796 | 0 \ |
| 2797 | -c "client hello, adding session ticket extension" \ |
| 2798 | -s "found session ticket extension" \ |
| 2799 | -s "server hello, adding session ticket extension" \ |
| 2800 | -c "found session_ticket extension" \ |
| 2801 | -c "parse new session ticket" \ |
| 2802 | -S "session successfully restored from cache" \ |
| 2803 | -S "session successfully restored from ticket" \ |
| 2804 | -S "a session has been resumed" \ |
| 2805 | -C "a session has been resumed" |
| 2806 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2807 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2808 | "$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] | 2809 | "$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] | 2810 | 0 \ |
| 2811 | -c "client hello, adding session ticket extension" \ |
| 2812 | -s "found session ticket extension" \ |
| 2813 | -s "server hello, adding session ticket extension" \ |
| 2814 | -c "found session_ticket extension" \ |
| 2815 | -c "parse new session ticket" \ |
| 2816 | -S "session successfully restored from cache" \ |
| 2817 | -s "session successfully restored from ticket" \ |
| 2818 | -s "a session has been resumed" \ |
| 2819 | -c "a session has been resumed" |
| 2820 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2821 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2822 | "$O_SRV -dtls" \ |
| 2823 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2824 | 0 \ |
| 2825 | -c "client hello, adding session ticket extension" \ |
| 2826 | -c "found session_ticket extension" \ |
| 2827 | -c "parse new session ticket" \ |
| 2828 | -c "a session has been resumed" |
| 2829 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2830 | # 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] | 2831 | # 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] | 2832 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2833 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2834 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2835 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 2836 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2837 | rm -f $SESSION )" \ |
| 2838 | 0 \ |
| 2839 | -s "found session ticket extension" \ |
| 2840 | -s "server hello, adding session ticket extension" \ |
| 2841 | -S "session successfully restored from cache" \ |
| 2842 | -s "session successfully restored from ticket" \ |
| 2843 | -s "a session has been resumed" |
| 2844 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2845 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2846 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2847 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2848 | "$P_SRV debug_level=3 tickets=0" \ |
| 2849 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2850 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2851 | -c "client hello, adding session ticket extension" \ |
| 2852 | -s "found session ticket extension" \ |
| 2853 | -S "server hello, adding session ticket extension" \ |
| 2854 | -C "found session_ticket extension" \ |
| 2855 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2856 | -s "session successfully restored from cache" \ |
| 2857 | -S "session successfully restored from ticket" \ |
| 2858 | -s "a session has been resumed" \ |
| 2859 | -c "a session has been resumed" |
| 2860 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2861 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2862 | "$P_SRV debug_level=3 tickets=1" \ |
| 2863 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2864 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2865 | -C "client hello, adding session ticket extension" \ |
| 2866 | -S "found session ticket extension" \ |
| 2867 | -S "server hello, adding session ticket extension" \ |
| 2868 | -C "found session_ticket extension" \ |
| 2869 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2870 | -s "session successfully restored from cache" \ |
| 2871 | -S "session successfully restored from ticket" \ |
| 2872 | -s "a session has been resumed" \ |
| 2873 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2874 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2875 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2876 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2877 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2878 | 0 \ |
| 2879 | -S "session successfully restored from cache" \ |
| 2880 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2881 | -S "a session has been resumed" \ |
| 2882 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2883 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2884 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2885 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2886 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2887 | 0 \ |
| 2888 | -s "session successfully restored from cache" \ |
| 2889 | -S "session successfully restored from ticket" \ |
| 2890 | -s "a session has been resumed" \ |
| 2891 | -c "a session has been resumed" |
| 2892 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2893 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2894 | "$P_SRV debug_level=3 tickets=0" \ |
| 2895 | "$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] | 2896 | 0 \ |
| 2897 | -s "session successfully restored from cache" \ |
| 2898 | -S "session successfully restored from ticket" \ |
| 2899 | -s "a session has been resumed" \ |
| 2900 | -c "a session has been resumed" |
| 2901 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2902 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2903 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2904 | "$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] | 2905 | 0 \ |
| 2906 | -S "session successfully restored from cache" \ |
| 2907 | -S "session successfully restored from ticket" \ |
| 2908 | -S "a session has been resumed" \ |
| 2909 | -C "a session has been resumed" |
| 2910 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2911 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2912 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2913 | "$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] | 2914 | 0 \ |
| 2915 | -s "session successfully restored from cache" \ |
| 2916 | -S "session successfully restored from ticket" \ |
| 2917 | -s "a session has been resumed" \ |
| 2918 | -c "a session has been resumed" |
| 2919 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2920 | run_test "Session resume using cache: session copy" \ |
| 2921 | "$P_SRV debug_level=3 tickets=0" \ |
| 2922 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2923 | 0 \ |
| 2924 | -s "session successfully restored from cache" \ |
| 2925 | -S "session successfully restored from ticket" \ |
| 2926 | -s "a session has been resumed" \ |
| 2927 | -c "a session has been resumed" |
| 2928 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2929 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2930 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2931 | "( $O_CLI -sess_out $SESSION; \ |
| 2932 | $O_CLI -sess_in $SESSION; \ |
| 2933 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2934 | 0 \ |
| 2935 | -s "found session ticket extension" \ |
| 2936 | -S "server hello, adding session ticket extension" \ |
| 2937 | -s "session successfully restored from cache" \ |
| 2938 | -S "session successfully restored from ticket" \ |
| 2939 | -s "a session has been resumed" |
| 2940 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2941 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2942 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2943 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2944 | 0 \ |
| 2945 | -C "found session_ticket extension" \ |
| 2946 | -C "parse new session ticket" \ |
| 2947 | -c "a session has been resumed" |
| 2948 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2949 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2950 | |
| 2951 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2952 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2953 | "$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] | 2954 | 0 \ |
| 2955 | -c "client hello, adding session ticket extension" \ |
| 2956 | -s "found session ticket extension" \ |
| 2957 | -S "server hello, adding session ticket extension" \ |
| 2958 | -C "found session_ticket extension" \ |
| 2959 | -C "parse new session ticket" \ |
| 2960 | -s "session successfully restored from cache" \ |
| 2961 | -S "session successfully restored from ticket" \ |
| 2962 | -s "a session has been resumed" \ |
| 2963 | -c "a session has been resumed" |
| 2964 | |
| 2965 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2966 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2967 | "$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] | 2968 | 0 \ |
| 2969 | -C "client hello, adding session ticket extension" \ |
| 2970 | -S "found session ticket extension" \ |
| 2971 | -S "server hello, adding session ticket extension" \ |
| 2972 | -C "found session_ticket extension" \ |
| 2973 | -C "parse new session ticket" \ |
| 2974 | -s "session successfully restored from cache" \ |
| 2975 | -S "session successfully restored from ticket" \ |
| 2976 | -s "a session has been resumed" \ |
| 2977 | -c "a session has been resumed" |
| 2978 | |
| 2979 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2980 | "$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] | 2981 | "$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] | 2982 | 0 \ |
| 2983 | -S "session successfully restored from cache" \ |
| 2984 | -S "session successfully restored from ticket" \ |
| 2985 | -S "a session has been resumed" \ |
| 2986 | -C "a session has been resumed" |
| 2987 | |
| 2988 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2989 | "$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] | 2990 | "$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] | 2991 | 0 \ |
| 2992 | -s "session successfully restored from cache" \ |
| 2993 | -S "session successfully restored from ticket" \ |
| 2994 | -s "a session has been resumed" \ |
| 2995 | -c "a session has been resumed" |
| 2996 | |
| 2997 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2998 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2999 | "$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] | 3000 | 0 \ |
| 3001 | -s "session successfully restored from cache" \ |
| 3002 | -S "session successfully restored from ticket" \ |
| 3003 | -s "a session has been resumed" \ |
| 3004 | -c "a session has been resumed" |
| 3005 | |
| 3006 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3007 | "$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] | 3008 | "$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] | 3009 | 0 \ |
| 3010 | -S "session successfully restored from cache" \ |
| 3011 | -S "session successfully restored from ticket" \ |
| 3012 | -S "a session has been resumed" \ |
| 3013 | -C "a session has been resumed" |
| 3014 | |
| 3015 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3016 | "$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] | 3017 | "$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] | 3018 | 0 \ |
| 3019 | -s "session successfully restored from cache" \ |
| 3020 | -S "session successfully restored from ticket" \ |
| 3021 | -s "a session has been resumed" \ |
| 3022 | -c "a session has been resumed" |
| 3023 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3024 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3025 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3026 | "$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] | 3027 | 0 \ |
| 3028 | -s "session successfully restored from cache" \ |
| 3029 | -S "session successfully restored from ticket" \ |
| 3030 | -s "a session has been resumed" \ |
| 3031 | -c "a session has been resumed" |
| 3032 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3033 | # 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] | 3034 | # 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] | 3035 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3036 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3037 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3038 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3039 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3040 | rm -f $SESSION )" \ |
| 3041 | 0 \ |
| 3042 | -s "found session ticket extension" \ |
| 3043 | -S "server hello, adding session ticket extension" \ |
| 3044 | -s "session successfully restored from cache" \ |
| 3045 | -S "session successfully restored from ticket" \ |
| 3046 | -s "a session has been resumed" |
| 3047 | |
| 3048 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3049 | "$O_SRV -dtls" \ |
| 3050 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3051 | 0 \ |
| 3052 | -C "found session_ticket extension" \ |
| 3053 | -C "parse new session ticket" \ |
| 3054 | -c "a session has been resumed" |
| 3055 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3056 | # Tests for Max Fragment Length extension |
| 3057 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3058 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3059 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3060 | "$P_SRV debug_level=3" \ |
| 3061 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3062 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3063 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3064 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3065 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3066 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3067 | -C "client hello, adding max_fragment_length extension" \ |
| 3068 | -S "found max fragment length extension" \ |
| 3069 | -S "server hello, max_fragment_length extension" \ |
| 3070 | -C "found max_fragment_length extension" |
| 3071 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3072 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3073 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3074 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3075 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3076 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3077 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3078 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3079 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3080 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3081 | -C "client hello, adding max_fragment_length extension" \ |
| 3082 | -S "found max fragment length extension" \ |
| 3083 | -S "server hello, max_fragment_length extension" \ |
| 3084 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3085 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3086 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3087 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3088 | |
| 3089 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3090 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3091 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3092 | "$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] | 3093 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3094 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3095 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3096 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3097 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3098 | -C "client hello, adding max_fragment_length extension" \ |
| 3099 | -S "found max fragment length extension" \ |
| 3100 | -S "server hello, max_fragment_length extension" \ |
| 3101 | -C "found max_fragment_length extension" \ |
| 3102 | -c "fragment larger than.*maximum " |
| 3103 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3104 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3105 | # (session fragment length will be 16384 regardless of mbedtls |
| 3106 | # content length configuration.) |
| 3107 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3108 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3109 | run_test "Max fragment length: disabled, larger message" \ |
| 3110 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3111 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3112 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3113 | -C "Maximum incoming record payload length is 16384" \ |
| 3114 | -C "Maximum outgoing record payload length is 16384" \ |
| 3115 | -S "Maximum incoming record payload length is 16384" \ |
| 3116 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3117 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3118 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3119 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3120 | |
| 3121 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3122 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3123 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3124 | "$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] | 3125 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3126 | -C "Maximum incoming record payload length is 16384" \ |
| 3127 | -C "Maximum outgoing record payload length is 16384" \ |
| 3128 | -S "Maximum incoming record payload length is 16384" \ |
| 3129 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3130 | -c "fragment larger than.*maximum " |
| 3131 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3132 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3133 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3134 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3135 | "$P_SRV debug_level=3" \ |
| 3136 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3137 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3138 | -c "Maximum incoming record payload length is 4096" \ |
| 3139 | -c "Maximum outgoing record payload length is 4096" \ |
| 3140 | -s "Maximum incoming record payload length is 4096" \ |
| 3141 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3142 | -c "client hello, adding max_fragment_length extension" \ |
| 3143 | -s "found max fragment length extension" \ |
| 3144 | -s "server hello, max_fragment_length extension" \ |
| 3145 | -c "found max_fragment_length extension" |
| 3146 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3147 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3148 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3149 | run_test "Max fragment length: client 512, server 1024" \ |
| 3150 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3151 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3152 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3153 | -c "Maximum incoming record payload length is 512" \ |
| 3154 | -c "Maximum outgoing record payload length is 512" \ |
| 3155 | -s "Maximum incoming record payload length is 512" \ |
| 3156 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3157 | -c "client hello, adding max_fragment_length extension" \ |
| 3158 | -s "found max fragment length extension" \ |
| 3159 | -s "server hello, max_fragment_length extension" \ |
| 3160 | -c "found max_fragment_length extension" |
| 3161 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3162 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3163 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3164 | run_test "Max fragment length: client 512, server 2048" \ |
| 3165 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3166 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3167 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3168 | -c "Maximum incoming record payload length is 512" \ |
| 3169 | -c "Maximum outgoing record payload length is 512" \ |
| 3170 | -s "Maximum incoming record payload length is 512" \ |
| 3171 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3172 | -c "client hello, adding max_fragment_length extension" \ |
| 3173 | -s "found max fragment length extension" \ |
| 3174 | -s "server hello, max_fragment_length extension" \ |
| 3175 | -c "found max_fragment_length extension" |
| 3176 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3177 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3178 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3179 | run_test "Max fragment length: client 512, server 4096" \ |
| 3180 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3181 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3182 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3183 | -c "Maximum incoming record payload length is 512" \ |
| 3184 | -c "Maximum outgoing record payload length is 512" \ |
| 3185 | -s "Maximum incoming record payload length is 512" \ |
| 3186 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3187 | -c "client hello, adding max_fragment_length extension" \ |
| 3188 | -s "found max fragment length extension" \ |
| 3189 | -s "server hello, max_fragment_length extension" \ |
| 3190 | -c "found max_fragment_length extension" |
| 3191 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3192 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3193 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3194 | run_test "Max fragment length: client 1024, server 512" \ |
| 3195 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3196 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3197 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3198 | -c "Maximum incoming record payload length is 1024" \ |
| 3199 | -c "Maximum outgoing record payload length is 1024" \ |
| 3200 | -s "Maximum incoming record payload length is 1024" \ |
| 3201 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3202 | -c "client hello, adding max_fragment_length extension" \ |
| 3203 | -s "found max fragment length extension" \ |
| 3204 | -s "server hello, max_fragment_length extension" \ |
| 3205 | -c "found max_fragment_length extension" |
| 3206 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3207 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3208 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3209 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3210 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3211 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3212 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3213 | -c "Maximum incoming record payload length is 1024" \ |
| 3214 | -c "Maximum outgoing record payload length is 1024" \ |
| 3215 | -s "Maximum incoming record payload length is 1024" \ |
| 3216 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3217 | -c "client hello, adding max_fragment_length extension" \ |
| 3218 | -s "found max fragment length extension" \ |
| 3219 | -s "server hello, max_fragment_length extension" \ |
| 3220 | -c "found max_fragment_length extension" |
| 3221 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3222 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3223 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3224 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3225 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3226 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3227 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3228 | -c "Maximum incoming record payload length is 1024" \ |
| 3229 | -c "Maximum outgoing record payload length is 1024" \ |
| 3230 | -s "Maximum incoming record payload length is 1024" \ |
| 3231 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3232 | -c "client hello, adding max_fragment_length extension" \ |
| 3233 | -s "found max fragment length extension" \ |
| 3234 | -s "server hello, max_fragment_length extension" \ |
| 3235 | -c "found max_fragment_length extension" |
| 3236 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3237 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3238 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3239 | run_test "Max fragment length: client 2048, server 512" \ |
| 3240 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3241 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3242 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3243 | -c "Maximum incoming record payload length is 2048" \ |
| 3244 | -c "Maximum outgoing record payload length is 2048" \ |
| 3245 | -s "Maximum incoming record payload length is 2048" \ |
| 3246 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3247 | -c "client hello, adding max_fragment_length extension" \ |
| 3248 | -s "found max fragment length extension" \ |
| 3249 | -s "server hello, max_fragment_length extension" \ |
| 3250 | -c "found max_fragment_length extension" |
| 3251 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3252 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3253 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3254 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3255 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3256 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3257 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3258 | -c "Maximum incoming record payload length is 2048" \ |
| 3259 | -c "Maximum outgoing record payload length is 2048" \ |
| 3260 | -s "Maximum incoming record payload length is 2048" \ |
| 3261 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3262 | -c "client hello, adding max_fragment_length extension" \ |
| 3263 | -s "found max fragment length extension" \ |
| 3264 | -s "server hello, max_fragment_length extension" \ |
| 3265 | -c "found max_fragment_length extension" |
| 3266 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3267 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3268 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3269 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3270 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3271 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3272 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3273 | -c "Maximum incoming record payload length is 2048" \ |
| 3274 | -c "Maximum outgoing record payload length is 2048" \ |
| 3275 | -s "Maximum incoming record payload length is 2048" \ |
| 3276 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3277 | -c "client hello, adding max_fragment_length extension" \ |
| 3278 | -s "found max fragment length extension" \ |
| 3279 | -s "server hello, max_fragment_length extension" \ |
| 3280 | -c "found max_fragment_length extension" |
| 3281 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3282 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3283 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3284 | run_test "Max fragment length: client 4096, server 512" \ |
| 3285 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3286 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3287 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3288 | -c "Maximum incoming record payload length is 4096" \ |
| 3289 | -c "Maximum outgoing record payload length is 4096" \ |
| 3290 | -s "Maximum incoming record payload length is 4096" \ |
| 3291 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3292 | -c "client hello, adding max_fragment_length extension" \ |
| 3293 | -s "found max fragment length extension" \ |
| 3294 | -s "server hello, max_fragment_length extension" \ |
| 3295 | -c "found max_fragment_length extension" |
| 3296 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3297 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3298 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3299 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3300 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3301 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3302 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3303 | -c "Maximum incoming record payload length is 4096" \ |
| 3304 | -c "Maximum outgoing record payload length is 4096" \ |
| 3305 | -s "Maximum incoming record payload length is 4096" \ |
| 3306 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3307 | -c "client hello, adding max_fragment_length extension" \ |
| 3308 | -s "found max fragment length extension" \ |
| 3309 | -s "server hello, max_fragment_length extension" \ |
| 3310 | -c "found max_fragment_length extension" |
| 3311 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3312 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3313 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3314 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3315 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3316 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3317 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3318 | -c "Maximum incoming record payload length is 4096" \ |
| 3319 | -c "Maximum outgoing record payload length is 4096" \ |
| 3320 | -s "Maximum incoming record payload length is 4096" \ |
| 3321 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3322 | -c "client hello, adding max_fragment_length extension" \ |
| 3323 | -s "found max fragment length extension" \ |
| 3324 | -s "server hello, max_fragment_length extension" \ |
| 3325 | -c "found max_fragment_length extension" |
| 3326 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3327 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3328 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3329 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3330 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3331 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3332 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3333 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3334 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3335 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3336 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3337 | -C "client hello, adding max_fragment_length extension" \ |
| 3338 | -S "found max fragment length extension" \ |
| 3339 | -S "server hello, max_fragment_length extension" \ |
| 3340 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3341 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3342 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3343 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3344 | requires_gnutls |
| 3345 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3346 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3347 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3348 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3349 | -c "Maximum incoming record payload length is 4096" \ |
| 3350 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3351 | -c "client hello, adding max_fragment_length extension" \ |
| 3352 | -c "found max_fragment_length extension" |
| 3353 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3354 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3355 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3356 | run_test "Max fragment length: client, message just fits" \ |
| 3357 | "$P_SRV debug_level=3" \ |
| 3358 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3359 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3360 | -c "Maximum incoming record payload length is 2048" \ |
| 3361 | -c "Maximum outgoing record payload length is 2048" \ |
| 3362 | -s "Maximum incoming record payload length is 2048" \ |
| 3363 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3364 | -c "client hello, adding max_fragment_length extension" \ |
| 3365 | -s "found max fragment length extension" \ |
| 3366 | -s "server hello, max_fragment_length extension" \ |
| 3367 | -c "found max_fragment_length extension" \ |
| 3368 | -c "2048 bytes written in 1 fragments" \ |
| 3369 | -s "2048 bytes read" |
| 3370 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3371 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3372 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3373 | run_test "Max fragment length: client, larger message" \ |
| 3374 | "$P_SRV debug_level=3" \ |
| 3375 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3376 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3377 | -c "Maximum incoming record payload length is 2048" \ |
| 3378 | -c "Maximum outgoing record payload length is 2048" \ |
| 3379 | -s "Maximum incoming record payload length is 2048" \ |
| 3380 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3381 | -c "client hello, adding max_fragment_length extension" \ |
| 3382 | -s "found max fragment length extension" \ |
| 3383 | -s "server hello, max_fragment_length extension" \ |
| 3384 | -c "found max_fragment_length extension" \ |
| 3385 | -c "2345 bytes written in 2 fragments" \ |
| 3386 | -s "2048 bytes read" \ |
| 3387 | -s "297 bytes read" |
| 3388 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3389 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3390 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3391 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3392 | "$P_SRV debug_level=3 dtls=1" \ |
| 3393 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3394 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3395 | -c "Maximum incoming record payload length is 2048" \ |
| 3396 | -c "Maximum outgoing record payload length is 2048" \ |
| 3397 | -s "Maximum incoming record payload length is 2048" \ |
| 3398 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3399 | -c "client hello, adding max_fragment_length extension" \ |
| 3400 | -s "found max fragment length extension" \ |
| 3401 | -s "server hello, max_fragment_length extension" \ |
| 3402 | -c "found max_fragment_length extension" \ |
| 3403 | -c "fragment larger than.*maximum" |
| 3404 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3405 | # Tests for renegotiation |
| 3406 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3407 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3408 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3409 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3410 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3411 | 0 \ |
| 3412 | -C "client hello, adding renegotiation extension" \ |
| 3413 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3414 | -S "found renegotiation extension" \ |
| 3415 | -s "server hello, secure renegotiation extension" \ |
| 3416 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3417 | -C "=> renegotiate" \ |
| 3418 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3419 | -S "write hello request" |
| 3420 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3421 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3422 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3423 | "$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] | 3424 | "$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] | 3425 | 0 \ |
| 3426 | -c "client hello, adding renegotiation extension" \ |
| 3427 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3428 | -s "found renegotiation extension" \ |
| 3429 | -s "server hello, secure renegotiation extension" \ |
| 3430 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3431 | -c "=> renegotiate" \ |
| 3432 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3433 | -S "write hello request" |
| 3434 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3435 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3436 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3437 | "$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] | 3438 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3439 | 0 \ |
| 3440 | -c "client hello, adding renegotiation extension" \ |
| 3441 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3442 | -s "found renegotiation extension" \ |
| 3443 | -s "server hello, secure renegotiation extension" \ |
| 3444 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3445 | -c "=> renegotiate" \ |
| 3446 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3447 | -s "write hello request" |
| 3448 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3449 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3450 | # 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] | 3451 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3452 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3453 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3454 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3455 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3456 | 0 \ |
| 3457 | -c "client hello, adding renegotiation extension" \ |
| 3458 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3459 | -s "found renegotiation extension" \ |
| 3460 | -s "server hello, secure renegotiation extension" \ |
| 3461 | -c "found renegotiation extension" \ |
| 3462 | -c "=> renegotiate" \ |
| 3463 | -s "=> renegotiate" \ |
| 3464 | -S "write hello request" \ |
| 3465 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3466 | |
| 3467 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3468 | # 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] | 3469 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3470 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3471 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3472 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3473 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3474 | 0 \ |
| 3475 | -c "client hello, adding renegotiation extension" \ |
| 3476 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3477 | -s "found renegotiation extension" \ |
| 3478 | -s "server hello, secure renegotiation extension" \ |
| 3479 | -c "found renegotiation extension" \ |
| 3480 | -c "=> renegotiate" \ |
| 3481 | -s "=> renegotiate" \ |
| 3482 | -s "write hello request" \ |
| 3483 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3484 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3485 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3486 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3487 | "$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] | 3488 | "$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] | 3489 | 0 \ |
| 3490 | -c "client hello, adding renegotiation extension" \ |
| 3491 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3492 | -s "found renegotiation extension" \ |
| 3493 | -s "server hello, secure renegotiation extension" \ |
| 3494 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3495 | -c "=> renegotiate" \ |
| 3496 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3497 | -s "write hello request" |
| 3498 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3499 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3500 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3501 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3502 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3503 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3504 | "$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" \ |
| 3505 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3506 | -c "Maximum incoming record payload length is 2048" \ |
| 3507 | -c "Maximum outgoing record payload length is 2048" \ |
| 3508 | -s "Maximum incoming record payload length is 2048" \ |
| 3509 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3510 | -c "client hello, adding max_fragment_length extension" \ |
| 3511 | -s "found max fragment length extension" \ |
| 3512 | -s "server hello, max_fragment_length extension" \ |
| 3513 | -c "found max_fragment_length extension" \ |
| 3514 | -c "client hello, adding renegotiation extension" \ |
| 3515 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3516 | -s "found renegotiation extension" \ |
| 3517 | -s "server hello, secure renegotiation extension" \ |
| 3518 | -c "found renegotiation extension" \ |
| 3519 | -c "=> renegotiate" \ |
| 3520 | -s "=> renegotiate" \ |
| 3521 | -s "write hello request" |
| 3522 | |
| 3523 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3524 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3525 | "$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] | 3526 | "$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] | 3527 | 1 \ |
| 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" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3533 | -c "=> renegotiate" \ |
| 3534 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3535 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3536 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3537 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 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, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3541 | "$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] | 3542 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3543 | 0 \ |
| 3544 | -C "client hello, adding renegotiation extension" \ |
| 3545 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3546 | -S "found renegotiation extension" \ |
| 3547 | -s "server hello, secure renegotiation extension" \ |
| 3548 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3549 | -C "=> renegotiate" \ |
| 3550 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3551 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3552 | -S "SSL - An unexpected message was received from our peer" \ |
| 3553 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [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-rejected, not enforced" \ |
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=-1 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=0" \ |
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 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3572 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3573 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3574 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3575 | "$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] | 3576 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3577 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3578 | 0 \ |
| 3579 | -C "client hello, adding renegotiation extension" \ |
| 3580 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3581 | -S "found renegotiation extension" \ |
| 3582 | -s "server hello, secure renegotiation extension" \ |
| 3583 | -c "found renegotiation extension" \ |
| 3584 | -C "=> renegotiate" \ |
| 3585 | -S "=> renegotiate" \ |
| 3586 | -s "write hello request" \ |
| 3587 | -S "SSL - An unexpected message was received from our peer" \ |
| 3588 | -S "failed" |
| 3589 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3590 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3591 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3592 | "$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] | 3593 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3594 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3595 | 0 \ |
| 3596 | -C "client hello, adding renegotiation extension" \ |
| 3597 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3598 | -S "found renegotiation extension" \ |
| 3599 | -s "server hello, secure renegotiation extension" \ |
| 3600 | -c "found renegotiation extension" \ |
| 3601 | -C "=> renegotiate" \ |
| 3602 | -S "=> renegotiate" \ |
| 3603 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3604 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3605 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3606 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3607 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3608 | "$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] | 3609 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3610 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3611 | 0 \ |
| 3612 | -c "client hello, adding renegotiation extension" \ |
| 3613 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3614 | -s "found renegotiation extension" \ |
| 3615 | -s "server hello, secure renegotiation extension" \ |
| 3616 | -c "found renegotiation extension" \ |
| 3617 | -c "=> renegotiate" \ |
| 3618 | -s "=> renegotiate" \ |
| 3619 | -s "write hello request" \ |
| 3620 | -S "SSL - An unexpected message was received from our peer" \ |
| 3621 | -S "failed" |
| 3622 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3623 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3624 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3625 | "$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] | 3626 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3627 | 0 \ |
| 3628 | -C "client hello, adding renegotiation extension" \ |
| 3629 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3630 | -S "found renegotiation extension" \ |
| 3631 | -s "server hello, secure renegotiation extension" \ |
| 3632 | -c "found renegotiation extension" \ |
| 3633 | -S "record counter limit reached: renegotiate" \ |
| 3634 | -C "=> renegotiate" \ |
| 3635 | -S "=> renegotiate" \ |
| 3636 | -S "write hello request" \ |
| 3637 | -S "SSL - An unexpected message was received from our peer" \ |
| 3638 | -S "failed" |
| 3639 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3640 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3641 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3642 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3643 | "$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] | 3644 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [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 | -s "record counter limit reached: renegotiate" \ |
| 3652 | -c "=> renegotiate" \ |
| 3653 | -s "=> renegotiate" \ |
| 3654 | -s "write hello request" \ |
| 3655 | -S "SSL - An unexpected message was received from our peer" \ |
| 3656 | -S "failed" |
| 3657 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3658 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3659 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3660 | "$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] | 3661 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3662 | 0 \ |
| 3663 | -c "client hello, adding renegotiation extension" \ |
| 3664 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3665 | -s "found renegotiation extension" \ |
| 3666 | -s "server hello, secure renegotiation extension" \ |
| 3667 | -c "found renegotiation extension" \ |
| 3668 | -s "record counter limit reached: renegotiate" \ |
| 3669 | -c "=> renegotiate" \ |
| 3670 | -s "=> renegotiate" \ |
| 3671 | -s "write hello request" \ |
| 3672 | -S "SSL - An unexpected message was received from our peer" \ |
| 3673 | -S "failed" |
| 3674 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3675 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3676 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3677 | "$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] | 3678 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3679 | 0 \ |
| 3680 | -C "client hello, adding renegotiation extension" \ |
| 3681 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3682 | -S "found renegotiation extension" \ |
| 3683 | -s "server hello, secure renegotiation extension" \ |
| 3684 | -c "found renegotiation extension" \ |
| 3685 | -S "record counter limit reached: renegotiate" \ |
| 3686 | -C "=> renegotiate" \ |
| 3687 | -S "=> renegotiate" \ |
| 3688 | -S "write hello request" \ |
| 3689 | -S "SSL - An unexpected message was received from our peer" \ |
| 3690 | -S "failed" |
| 3691 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3692 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3693 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3694 | "$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] | 3695 | "$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] | 3696 | 0 \ |
| 3697 | -c "client hello, adding renegotiation extension" \ |
| 3698 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3699 | -s "found renegotiation extension" \ |
| 3700 | -s "server hello, secure renegotiation extension" \ |
| 3701 | -c "found renegotiation extension" \ |
| 3702 | -c "=> renegotiate" \ |
| 3703 | -s "=> renegotiate" \ |
| 3704 | -S "write hello request" |
| 3705 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3706 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3707 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3708 | "$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] | 3709 | "$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] | 3710 | 0 \ |
| 3711 | -c "client hello, adding renegotiation extension" \ |
| 3712 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3713 | -s "found renegotiation extension" \ |
| 3714 | -s "server hello, secure renegotiation extension" \ |
| 3715 | -c "found renegotiation extension" \ |
| 3716 | -c "=> renegotiate" \ |
| 3717 | -s "=> renegotiate" \ |
| 3718 | -s "write hello request" |
| 3719 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3720 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3721 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3722 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3723 | "$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] | 3724 | 0 \ |
| 3725 | -c "client hello, adding renegotiation extension" \ |
| 3726 | -c "found renegotiation extension" \ |
| 3727 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3728 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3729 | -C "error" \ |
| 3730 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3731 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3732 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3733 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3734 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3735 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3736 | "$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] | 3737 | 0 \ |
| 3738 | -c "client hello, adding renegotiation extension" \ |
| 3739 | -c "found renegotiation extension" \ |
| 3740 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3741 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3742 | -C "error" \ |
| 3743 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3744 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3745 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3746 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3747 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3748 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3749 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3750 | 1 \ |
| 3751 | -c "client hello, adding renegotiation extension" \ |
| 3752 | -C "found renegotiation extension" \ |
| 3753 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3754 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3755 | -c "error" \ |
| 3756 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3757 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3758 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3759 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3760 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3761 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3762 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3763 | allow_legacy=0" \ |
| 3764 | 1 \ |
| 3765 | -c "client hello, adding renegotiation extension" \ |
| 3766 | -C "found renegotiation extension" \ |
| 3767 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3768 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3769 | -c "error" \ |
| 3770 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3771 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3772 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3773 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3774 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3775 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3776 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3777 | allow_legacy=1" \ |
| 3778 | 0 \ |
| 3779 | -c "client hello, adding renegotiation extension" \ |
| 3780 | -C "found renegotiation extension" \ |
| 3781 | -c "=> renegotiate" \ |
| 3782 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3783 | -C "error" \ |
| 3784 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3785 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3786 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3787 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3788 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3789 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3790 | 0 \ |
| 3791 | -c "client hello, adding renegotiation extension" \ |
| 3792 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3793 | -s "found renegotiation extension" \ |
| 3794 | -s "server hello, secure renegotiation extension" \ |
| 3795 | -c "found renegotiation extension" \ |
| 3796 | -c "=> renegotiate" \ |
| 3797 | -s "=> renegotiate" \ |
| 3798 | -S "write hello request" |
| 3799 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3800 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3801 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3802 | "$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] | 3803 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3804 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3805 | 0 \ |
| 3806 | -c "client hello, adding renegotiation extension" \ |
| 3807 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3808 | -s "found renegotiation extension" \ |
| 3809 | -s "server hello, secure renegotiation extension" \ |
| 3810 | -c "found renegotiation extension" \ |
| 3811 | -c "=> renegotiate" \ |
| 3812 | -s "=> renegotiate" \ |
| 3813 | -s "write hello request" |
| 3814 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3815 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3816 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3817 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3818 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3819 | 0 \ |
| 3820 | -c "client hello, adding renegotiation extension" \ |
| 3821 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3822 | -s "found renegotiation extension" \ |
| 3823 | -s "server hello, secure renegotiation extension" \ |
| 3824 | -s "record counter limit reached: renegotiate" \ |
| 3825 | -c "=> renegotiate" \ |
| 3826 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3827 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3828 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3829 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3830 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3831 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3832 | "$G_SRV -u --mtu 4096" \ |
| 3833 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3834 | 0 \ |
| 3835 | -c "client hello, adding renegotiation extension" \ |
| 3836 | -c "found renegotiation extension" \ |
| 3837 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3838 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3839 | -C "error" \ |
| 3840 | -s "Extra-header:" |
| 3841 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3842 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3843 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3844 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3845 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3846 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3847 | "$P_CLI debug_level=3" \ |
| 3848 | 0 \ |
| 3849 | -c "found renegotiation extension" \ |
| 3850 | -C "error" \ |
| 3851 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3852 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3853 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3854 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3855 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3856 | "$P_CLI debug_level=3" \ |
| 3857 | 0 \ |
| 3858 | -C "found renegotiation extension" \ |
| 3859 | -C "error" \ |
| 3860 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3861 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3862 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3863 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3864 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3865 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3866 | 1 \ |
| 3867 | -C "found renegotiation extension" \ |
| 3868 | -c "error" \ |
| 3869 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3870 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3871 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3872 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3873 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3874 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3875 | 0 \ |
| 3876 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3877 | -s "server hello, secure renegotiation extension" |
| 3878 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3879 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3880 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3881 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3882 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3883 | 0 \ |
| 3884 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3885 | -S "server hello, secure renegotiation extension" |
| 3886 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3887 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3888 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3889 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3890 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3891 | 1 \ |
| 3892 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3893 | -S "server hello, secure renegotiation extension" |
| 3894 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3895 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3896 | |
| 3897 | requires_gnutls |
| 3898 | run_test "DER format: no trailing bytes" \ |
| 3899 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3900 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3901 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3902 | 0 \ |
| 3903 | -c "Handshake was completed" \ |
| 3904 | |
| 3905 | requires_gnutls |
| 3906 | run_test "DER format: with a trailing zero byte" \ |
| 3907 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3908 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3909 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3910 | 0 \ |
| 3911 | -c "Handshake was completed" \ |
| 3912 | |
| 3913 | requires_gnutls |
| 3914 | run_test "DER format: with a trailing random byte" \ |
| 3915 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3916 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3917 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3918 | 0 \ |
| 3919 | -c "Handshake was completed" \ |
| 3920 | |
| 3921 | requires_gnutls |
| 3922 | run_test "DER format: with 2 trailing random bytes" \ |
| 3923 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3924 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3925 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3926 | 0 \ |
| 3927 | -c "Handshake was completed" \ |
| 3928 | |
| 3929 | requires_gnutls |
| 3930 | run_test "DER format: with 4 trailing random bytes" \ |
| 3931 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3932 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3933 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3934 | 0 \ |
| 3935 | -c "Handshake was completed" \ |
| 3936 | |
| 3937 | requires_gnutls |
| 3938 | run_test "DER format: with 8 trailing random bytes" \ |
| 3939 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3940 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3941 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3942 | 0 \ |
| 3943 | -c "Handshake was completed" \ |
| 3944 | |
| 3945 | requires_gnutls |
| 3946 | run_test "DER format: with 9 trailing random bytes" \ |
| 3947 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3948 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3949 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3950 | 0 \ |
| 3951 | -c "Handshake was completed" \ |
| 3952 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3953 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3954 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3955 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3956 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3957 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3958 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3959 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3960 | 1 \ |
| 3961 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3962 | -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] | 3963 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3964 | -c "X509 - Certificate verification failed" |
| 3965 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3966 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3967 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3968 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3969 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3970 | 0 \ |
| 3971 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3972 | -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] | 3973 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3974 | -C "X509 - Certificate verification failed" |
| 3975 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3976 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3977 | "$P_SRV" \ |
| 3978 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3979 | 0 \ |
| 3980 | -c "x509_verify_cert() returned" \ |
| 3981 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3982 | -c "! Certificate verification flags"\ |
| 3983 | -C "! mbedtls_ssl_handshake returned" \ |
| 3984 | -C "X509 - Certificate verification failed" \ |
| 3985 | -C "SSL - No CA Chain is set, but required to operate" |
| 3986 | |
| 3987 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3988 | "$P_SRV" \ |
| 3989 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3990 | 1 \ |
| 3991 | -c "x509_verify_cert() returned" \ |
| 3992 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3993 | -c "! Certificate verification flags"\ |
| 3994 | -c "! mbedtls_ssl_handshake returned" \ |
| 3995 | -c "SSL - No CA Chain is set, but required to operate" |
| 3996 | |
| 3997 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3998 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3999 | # the client informs the server about the supported curves - it does, though, in the |
| 4000 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4001 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4002 | # different means to have the server ignoring the client's supported curve list. |
| 4003 | |
| 4004 | requires_config_enabled MBEDTLS_ECP_C |
| 4005 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4006 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4007 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4008 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4009 | 1 \ |
| 4010 | -c "bad certificate (EC key curve)"\ |
| 4011 | -c "! Certificate verification flags"\ |
| 4012 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4013 | |
| 4014 | requires_config_enabled MBEDTLS_ECP_C |
| 4015 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4016 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4017 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4018 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4019 | 1 \ |
| 4020 | -c "bad certificate (EC key curve)"\ |
| 4021 | -c "! Certificate verification flags"\ |
| 4022 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4023 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4024 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4025 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4026 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4027 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4028 | 0 \ |
| 4029 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4030 | -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] | 4031 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4032 | -C "X509 - Certificate verification failed" |
| 4033 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4034 | run_test "Authentication: client SHA256, server required" \ |
| 4035 | "$P_SRV auth_mode=required" \ |
| 4036 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4037 | key_file=data_files/server6.key \ |
| 4038 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4039 | 0 \ |
| 4040 | -c "Supported Signature Algorithm found: 4," \ |
| 4041 | -c "Supported Signature Algorithm found: 5," |
| 4042 | |
| 4043 | run_test "Authentication: client SHA384, server required" \ |
| 4044 | "$P_SRV auth_mode=required" \ |
| 4045 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4046 | key_file=data_files/server6.key \ |
| 4047 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4048 | 0 \ |
| 4049 | -c "Supported Signature Algorithm found: 4," \ |
| 4050 | -c "Supported Signature Algorithm found: 5," |
| 4051 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4052 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4053 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4054 | "$P_CLI debug_level=3 crt_file=none \ |
| 4055 | key_file=data_files/server5.key" \ |
| 4056 | 1 \ |
| 4057 | -S "skip write certificate request" \ |
| 4058 | -C "skip parse certificate request" \ |
| 4059 | -c "got a certificate request" \ |
| 4060 | -c "= write certificate$" \ |
| 4061 | -C "skip write certificate$" \ |
| 4062 | -S "x509_verify_cert() returned" \ |
| 4063 | -s "client has no certificate" \ |
| 4064 | -s "! mbedtls_ssl_handshake returned" \ |
| 4065 | -c "! mbedtls_ssl_handshake returned" \ |
| 4066 | -s "No client certification received from the client, but required by the authentication mode" |
| 4067 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4068 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4069 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4070 | "$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] | 4071 | key_file=data_files/server5.key" \ |
| 4072 | 1 \ |
| 4073 | -S "skip write certificate request" \ |
| 4074 | -C "skip parse certificate request" \ |
| 4075 | -c "got a certificate request" \ |
| 4076 | -C "skip write certificate" \ |
| 4077 | -C "skip write certificate verify" \ |
| 4078 | -S "skip parse certificate verify" \ |
| 4079 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4080 | -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] | 4081 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4082 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4083 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4084 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4085 | # We don't check that the client receives the alert because it might |
| 4086 | # detect that its write end of the connection is closed and abort |
| 4087 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4088 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4089 | run_test "Authentication: client cert not trusted, server required" \ |
| 4090 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4091 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4092 | key_file=data_files/server5.key" \ |
| 4093 | 1 \ |
| 4094 | -S "skip write certificate request" \ |
| 4095 | -C "skip parse certificate request" \ |
| 4096 | -c "got a certificate request" \ |
| 4097 | -C "skip write certificate" \ |
| 4098 | -C "skip write certificate verify" \ |
| 4099 | -S "skip parse certificate verify" \ |
| 4100 | -s "x509_verify_cert() returned" \ |
| 4101 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4102 | -s "! mbedtls_ssl_handshake returned" \ |
| 4103 | -c "! mbedtls_ssl_handshake returned" \ |
| 4104 | -s "X509 - Certificate verification failed" |
| 4105 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4106 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4107 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4108 | "$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] | 4109 | key_file=data_files/server5.key" \ |
| 4110 | 0 \ |
| 4111 | -S "skip write certificate request" \ |
| 4112 | -C "skip parse certificate request" \ |
| 4113 | -c "got a certificate request" \ |
| 4114 | -C "skip write certificate" \ |
| 4115 | -C "skip write certificate verify" \ |
| 4116 | -S "skip parse certificate verify" \ |
| 4117 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4118 | -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] | 4119 | -S "! mbedtls_ssl_handshake returned" \ |
| 4120 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4121 | -S "X509 - Certificate verification failed" |
| 4122 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4123 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4124 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4125 | "$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] | 4126 | key_file=data_files/server5.key" \ |
| 4127 | 0 \ |
| 4128 | -s "skip write certificate request" \ |
| 4129 | -C "skip parse certificate request" \ |
| 4130 | -c "got no certificate request" \ |
| 4131 | -c "skip write certificate" \ |
| 4132 | -c "skip write certificate verify" \ |
| 4133 | -s "skip parse certificate verify" \ |
| 4134 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4135 | -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] | 4136 | -S "! mbedtls_ssl_handshake returned" \ |
| 4137 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4138 | -S "X509 - Certificate verification failed" |
| 4139 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4140 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4141 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4142 | "$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] | 4143 | 0 \ |
| 4144 | -S "skip write certificate request" \ |
| 4145 | -C "skip parse certificate request" \ |
| 4146 | -c "got a certificate request" \ |
| 4147 | -C "skip write certificate$" \ |
| 4148 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4149 | -c "skip write certificate verify" \ |
| 4150 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4151 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4152 | -S "! mbedtls_ssl_handshake returned" \ |
| 4153 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4154 | -S "X509 - Certificate verification failed" |
| 4155 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4156 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4157 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4158 | "$O_CLI" \ |
| 4159 | 0 \ |
| 4160 | -S "skip write certificate request" \ |
| 4161 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4162 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4163 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4164 | -S "X509 - Certificate verification failed" |
| 4165 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4166 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4167 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4168 | "$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] | 4169 | 0 \ |
| 4170 | -C "skip parse certificate request" \ |
| 4171 | -c "got a certificate request" \ |
| 4172 | -C "skip write certificate$" \ |
| 4173 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4174 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4175 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4176 | run_test "Authentication: client no cert, openssl server required" \ |
| 4177 | "$O_SRV -Verify 10" \ |
| 4178 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4179 | 1 \ |
| 4180 | -C "skip parse certificate request" \ |
| 4181 | -c "got a certificate request" \ |
| 4182 | -C "skip write certificate$" \ |
| 4183 | -c "skip write certificate verify" \ |
| 4184 | -c "! mbedtls_ssl_handshake returned" |
| 4185 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4186 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4187 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4188 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4189 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4190 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4191 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4192 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4193 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4194 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4195 | # 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] | 4196 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4197 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4198 | run_test "Authentication: server max_int chain, client default" \ |
| 4199 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4200 | key_file=data_files/dir-maxpath/09.key" \ |
| 4201 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4202 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4203 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4204 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4205 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4206 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4207 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4208 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4209 | key_file=data_files/dir-maxpath/10.key" \ |
| 4210 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4211 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4212 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4213 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4214 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4215 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4216 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4217 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4218 | key_file=data_files/dir-maxpath/10.key" \ |
| 4219 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4220 | auth_mode=optional" \ |
| 4221 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4222 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4223 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4224 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4225 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4226 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4227 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4228 | key_file=data_files/dir-maxpath/10.key" \ |
| 4229 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4230 | auth_mode=none" \ |
| 4231 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4232 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4233 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4234 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4235 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4236 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4237 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4238 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4239 | key_file=data_files/dir-maxpath/10.key" \ |
| 4240 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4241 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4242 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4243 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4244 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4245 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4246 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4247 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4248 | key_file=data_files/dir-maxpath/10.key" \ |
| 4249 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4250 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4251 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4252 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4253 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4254 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4255 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4256 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4257 | key_file=data_files/dir-maxpath/10.key" \ |
| 4258 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4259 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4260 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4261 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4262 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4263 | run_test "Authentication: client max_int chain, server required" \ |
| 4264 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4265 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4266 | key_file=data_files/dir-maxpath/09.key" \ |
| 4267 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4268 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4269 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4270 | # Tests for CA list in CertificateRequest messages |
| 4271 | |
| 4272 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4273 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4274 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4275 | key_file=data_files/server6.key" \ |
| 4276 | 0 \ |
| 4277 | -s "requested DN" |
| 4278 | |
| 4279 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4280 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4281 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4282 | key_file=data_files/server6.key" \ |
| 4283 | 0 \ |
| 4284 | -S "requested DN" |
| 4285 | |
| 4286 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4287 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4288 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4289 | key_file=data_files/server5.key" \ |
| 4290 | 1 \ |
| 4291 | -S "requested DN" \ |
| 4292 | -s "x509_verify_cert() returned" \ |
| 4293 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4294 | -s "! mbedtls_ssl_handshake returned" \ |
| 4295 | -c "! mbedtls_ssl_handshake returned" \ |
| 4296 | -s "X509 - Certificate verification failed" |
| 4297 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4298 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4299 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4300 | |
| 4301 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4302 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4303 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4304 | key_file=data_files/server5.key" \ |
| 4305 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4306 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4307 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4308 | -c "x509_verify_cert() returned" \ |
| 4309 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4310 | -c "! mbedtls_ssl_handshake returned" \ |
| 4311 | -c "X509 - Certificate verification failed" |
| 4312 | |
| 4313 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4314 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4315 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4316 | key_file=data_files/server5.key" \ |
| 4317 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4318 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4319 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4320 | -c "x509_verify_cert() returned" \ |
| 4321 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4322 | -C "! mbedtls_ssl_handshake returned" \ |
| 4323 | -C "X509 - Certificate verification failed" |
| 4324 | |
| 4325 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4326 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4327 | # the client informs the server about the supported curves - it does, though, in the |
| 4328 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4329 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4330 | # different means to have the server ignoring the client's supported curve list. |
| 4331 | |
| 4332 | requires_config_enabled MBEDTLS_ECP_C |
| 4333 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4334 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4335 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4336 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4337 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4338 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4339 | -c "use CA callback for X.509 CRT verification" \ |
| 4340 | -c "bad certificate (EC key curve)" \ |
| 4341 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4342 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4343 | |
| 4344 | requires_config_enabled MBEDTLS_ECP_C |
| 4345 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4346 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4347 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4348 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4349 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4350 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4351 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4352 | -c "bad certificate (EC key curve)"\ |
| 4353 | -c "! Certificate verification flags"\ |
| 4354 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4355 | |
| 4356 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4357 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4358 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4359 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4360 | key_file=data_files/server6.key \ |
| 4361 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4362 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4363 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4364 | -c "Supported Signature Algorithm found: 4," \ |
| 4365 | -c "Supported Signature Algorithm found: 5," |
| 4366 | |
| 4367 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4368 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4369 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4370 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4371 | key_file=data_files/server6.key \ |
| 4372 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4373 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4374 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4375 | -c "Supported Signature Algorithm found: 4," \ |
| 4376 | -c "Supported Signature Algorithm found: 5," |
| 4377 | |
| 4378 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4379 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4380 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4381 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4382 | key_file=data_files/server5.key" \ |
| 4383 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4384 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4385 | -S "skip write certificate request" \ |
| 4386 | -C "skip parse certificate request" \ |
| 4387 | -c "got a certificate request" \ |
| 4388 | -C "skip write certificate" \ |
| 4389 | -C "skip write certificate verify" \ |
| 4390 | -S "skip parse certificate verify" \ |
| 4391 | -s "x509_verify_cert() returned" \ |
| 4392 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4393 | -s "! mbedtls_ssl_handshake returned" \ |
| 4394 | -s "send alert level=2 message=48" \ |
| 4395 | -c "! mbedtls_ssl_handshake returned" \ |
| 4396 | -s "X509 - Certificate verification failed" |
| 4397 | # We don't check that the client receives the alert because it might |
| 4398 | # detect that its write end of the connection is closed and abort |
| 4399 | # before reading the alert message. |
| 4400 | |
| 4401 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4402 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4403 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4404 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4405 | key_file=data_files/server5.key" \ |
| 4406 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4407 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4408 | -S "skip write certificate request" \ |
| 4409 | -C "skip parse certificate request" \ |
| 4410 | -c "got a certificate request" \ |
| 4411 | -C "skip write certificate" \ |
| 4412 | -C "skip write certificate verify" \ |
| 4413 | -S "skip parse certificate verify" \ |
| 4414 | -s "x509_verify_cert() returned" \ |
| 4415 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4416 | -s "! mbedtls_ssl_handshake returned" \ |
| 4417 | -c "! mbedtls_ssl_handshake returned" \ |
| 4418 | -s "X509 - Certificate verification failed" |
| 4419 | |
| 4420 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4421 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4422 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4423 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4424 | key_file=data_files/server5.key" \ |
| 4425 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4426 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4427 | -S "skip write certificate request" \ |
| 4428 | -C "skip parse certificate request" \ |
| 4429 | -c "got a certificate request" \ |
| 4430 | -C "skip write certificate" \ |
| 4431 | -C "skip write certificate verify" \ |
| 4432 | -S "skip parse certificate verify" \ |
| 4433 | -s "x509_verify_cert() returned" \ |
| 4434 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4435 | -S "! mbedtls_ssl_handshake returned" \ |
| 4436 | -C "! mbedtls_ssl_handshake returned" \ |
| 4437 | -S "X509 - Certificate verification failed" |
| 4438 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4439 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4440 | requires_full_size_output_buffer |
| 4441 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4442 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4443 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4444 | key_file=data_files/dir-maxpath/09.key" \ |
| 4445 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4446 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4447 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4448 | -C "X509 - A fatal error occurred" |
| 4449 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4450 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4451 | requires_full_size_output_buffer |
| 4452 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4453 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4454 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4455 | key_file=data_files/dir-maxpath/10.key" \ |
| 4456 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4457 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4458 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4459 | -c "X509 - A fatal error occurred" |
| 4460 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4461 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4462 | requires_full_size_output_buffer |
| 4463 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4464 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4465 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4466 | key_file=data_files/dir-maxpath/10.key" \ |
| 4467 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4468 | debug_level=3 auth_mode=optional" \ |
| 4469 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4470 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4471 | -c "X509 - A fatal error occurred" |
| 4472 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4473 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4474 | requires_full_size_output_buffer |
| 4475 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4476 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4477 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4478 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4479 | key_file=data_files/dir-maxpath/10.key" \ |
| 4480 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4481 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4482 | -s "X509 - A fatal error occurred" |
| 4483 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4484 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4485 | requires_full_size_output_buffer |
| 4486 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4487 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4488 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4489 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4490 | key_file=data_files/dir-maxpath/10.key" \ |
| 4491 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4492 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4493 | -s "X509 - A fatal error occurred" |
| 4494 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4495 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4496 | requires_full_size_output_buffer |
| 4497 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4498 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4499 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4500 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4501 | key_file=data_files/dir-maxpath/09.key" \ |
| 4502 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4503 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4504 | -S "X509 - A fatal error occurred" |
| 4505 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4506 | # Tests for certificate selection based on SHA verson |
| 4507 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4508 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4509 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4510 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4511 | key_file=data_files/server5.key \ |
| 4512 | crt_file2=data_files/server5-sha1.crt \ |
| 4513 | key_file2=data_files/server5.key" \ |
| 4514 | "$P_CLI force_version=tls1_2" \ |
| 4515 | 0 \ |
| 4516 | -c "signed using.*ECDSA with SHA256" \ |
| 4517 | -C "signed using.*ECDSA with SHA1" |
| 4518 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4519 | # tests for SNI |
| 4520 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4521 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4522 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4523 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4524 | 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] | 4525 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4526 | 0 \ |
| 4527 | -S "parse ServerName extension" \ |
| 4528 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4529 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4530 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4531 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4532 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4533 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4534 | 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] | 4535 | 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] | 4536 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4537 | 0 \ |
| 4538 | -s "parse ServerName extension" \ |
| 4539 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4540 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4541 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4542 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4543 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4544 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4545 | 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] | 4546 | 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] | 4547 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4548 | 0 \ |
| 4549 | -s "parse ServerName extension" \ |
| 4550 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4551 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4552 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4553 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4554 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4555 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4556 | 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] | 4557 | 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] | 4558 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4559 | 1 \ |
| 4560 | -s "parse ServerName extension" \ |
| 4561 | -s "ssl_sni_wrapper() returned" \ |
| 4562 | -s "mbedtls_ssl_handshake returned" \ |
| 4563 | -c "mbedtls_ssl_handshake returned" \ |
| 4564 | -c "SSL - A fatal alert message was received from our peer" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4565 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4566 | run_test "SNI: client auth no override: optional" \ |
| 4567 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4568 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4569 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4570 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4571 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4572 | -S "skip write certificate request" \ |
| 4573 | -C "skip parse certificate request" \ |
| 4574 | -c "got a certificate request" \ |
| 4575 | -C "skip write certificate" \ |
| 4576 | -C "skip write certificate verify" \ |
| 4577 | -S "skip parse certificate verify" |
| 4578 | |
| 4579 | run_test "SNI: client auth override: none -> optional" \ |
| 4580 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4581 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4582 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4583 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4584 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4585 | -S "skip write certificate request" \ |
| 4586 | -C "skip parse certificate request" \ |
| 4587 | -c "got a certificate request" \ |
| 4588 | -C "skip write certificate" \ |
| 4589 | -C "skip write certificate verify" \ |
| 4590 | -S "skip parse certificate verify" |
| 4591 | |
| 4592 | run_test "SNI: client auth override: optional -> none" \ |
| 4593 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4594 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4595 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4596 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4597 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4598 | -s "skip write certificate request" \ |
| 4599 | -C "skip parse certificate request" \ |
| 4600 | -c "got no certificate request" \ |
| 4601 | -c "skip write certificate" \ |
| 4602 | -c "skip write certificate verify" \ |
| 4603 | -s "skip parse certificate verify" |
| 4604 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4605 | run_test "SNI: CA no override" \ |
| 4606 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4607 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4608 | ca_file=data_files/test-ca.crt \ |
| 4609 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4610 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4611 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4612 | 1 \ |
| 4613 | -S "skip write certificate request" \ |
| 4614 | -C "skip parse certificate request" \ |
| 4615 | -c "got a certificate request" \ |
| 4616 | -C "skip write certificate" \ |
| 4617 | -C "skip write certificate verify" \ |
| 4618 | -S "skip parse certificate verify" \ |
| 4619 | -s "x509_verify_cert() returned" \ |
| 4620 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4621 | -S "The certificate has been revoked (is on a CRL)" |
| 4622 | |
| 4623 | run_test "SNI: CA override" \ |
| 4624 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4625 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4626 | ca_file=data_files/test-ca.crt \ |
| 4627 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4628 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4629 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4630 | 0 \ |
| 4631 | -S "skip write certificate request" \ |
| 4632 | -C "skip parse certificate request" \ |
| 4633 | -c "got a certificate request" \ |
| 4634 | -C "skip write certificate" \ |
| 4635 | -C "skip write certificate verify" \ |
| 4636 | -S "skip parse certificate verify" \ |
| 4637 | -S "x509_verify_cert() returned" \ |
| 4638 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4639 | -S "The certificate has been revoked (is on a CRL)" |
| 4640 | |
| 4641 | run_test "SNI: CA override with CRL" \ |
| 4642 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4643 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4644 | ca_file=data_files/test-ca.crt \ |
| 4645 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4646 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4647 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4648 | 1 \ |
| 4649 | -S "skip write certificate request" \ |
| 4650 | -C "skip parse certificate request" \ |
| 4651 | -c "got a certificate request" \ |
| 4652 | -C "skip write certificate" \ |
| 4653 | -C "skip write certificate verify" \ |
| 4654 | -S "skip parse certificate verify" \ |
| 4655 | -s "x509_verify_cert() returned" \ |
| 4656 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4657 | -s "The certificate has been revoked (is on a CRL)" |
| 4658 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4659 | # Tests for SNI and DTLS |
| 4660 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4661 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4662 | run_test "SNI: DTLS, no SNI callback" \ |
| 4663 | "$P_SRV debug_level=3 dtls=1 \ |
| 4664 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4665 | "$P_CLI server_name=localhost dtls=1" \ |
| 4666 | 0 \ |
| 4667 | -S "parse ServerName extension" \ |
| 4668 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4669 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4670 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4671 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4672 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4673 | "$P_SRV debug_level=3 dtls=1 \ |
| 4674 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4675 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4676 | "$P_CLI server_name=localhost dtls=1" \ |
| 4677 | 0 \ |
| 4678 | -s "parse ServerName extension" \ |
| 4679 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4680 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4681 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4682 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4683 | run_test "SNI: DTLS, matching cert 2" \ |
| 4684 | "$P_SRV debug_level=3 dtls=1 \ |
| 4685 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4686 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4687 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4688 | 0 \ |
| 4689 | -s "parse ServerName extension" \ |
| 4690 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4691 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4692 | |
| 4693 | run_test "SNI: DTLS, no matching cert" \ |
| 4694 | "$P_SRV debug_level=3 dtls=1 \ |
| 4695 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4696 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4697 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4698 | 1 \ |
| 4699 | -s "parse ServerName extension" \ |
| 4700 | -s "ssl_sni_wrapper() returned" \ |
| 4701 | -s "mbedtls_ssl_handshake returned" \ |
| 4702 | -c "mbedtls_ssl_handshake returned" \ |
| 4703 | -c "SSL - A fatal alert message was received from our peer" |
| 4704 | |
| 4705 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4706 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4707 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4708 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4709 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4710 | 0 \ |
| 4711 | -S "skip write certificate request" \ |
| 4712 | -C "skip parse certificate request" \ |
| 4713 | -c "got a certificate request" \ |
| 4714 | -C "skip write certificate" \ |
| 4715 | -C "skip write certificate verify" \ |
| 4716 | -S "skip parse certificate verify" |
| 4717 | |
| 4718 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4719 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4720 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4721 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4722 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4723 | 0 \ |
| 4724 | -S "skip write certificate request" \ |
| 4725 | -C "skip parse certificate request" \ |
| 4726 | -c "got a certificate request" \ |
| 4727 | -C "skip write certificate" \ |
| 4728 | -C "skip write certificate verify" \ |
| 4729 | -S "skip parse certificate verify" |
| 4730 | |
| 4731 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4732 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4733 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4734 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4735 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4736 | 0 \ |
| 4737 | -s "skip write certificate request" \ |
| 4738 | -C "skip parse certificate request" \ |
| 4739 | -c "got no certificate request" \ |
| 4740 | -c "skip write certificate" \ |
| 4741 | -c "skip write certificate verify" \ |
| 4742 | -s "skip parse certificate verify" |
| 4743 | |
| 4744 | run_test "SNI: DTLS, CA no override" \ |
| 4745 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4746 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4747 | ca_file=data_files/test-ca.crt \ |
| 4748 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4749 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4750 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4751 | 1 \ |
| 4752 | -S "skip write certificate request" \ |
| 4753 | -C "skip parse certificate request" \ |
| 4754 | -c "got a certificate request" \ |
| 4755 | -C "skip write certificate" \ |
| 4756 | -C "skip write certificate verify" \ |
| 4757 | -S "skip parse certificate verify" \ |
| 4758 | -s "x509_verify_cert() returned" \ |
| 4759 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4760 | -S "The certificate has been revoked (is on a CRL)" |
| 4761 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4762 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4763 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4764 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4765 | ca_file=data_files/test-ca.crt \ |
| 4766 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4767 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4768 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4769 | 0 \ |
| 4770 | -S "skip write certificate request" \ |
| 4771 | -C "skip parse certificate request" \ |
| 4772 | -c "got a certificate request" \ |
| 4773 | -C "skip write certificate" \ |
| 4774 | -C "skip write certificate verify" \ |
| 4775 | -S "skip parse certificate verify" \ |
| 4776 | -S "x509_verify_cert() returned" \ |
| 4777 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4778 | -S "The certificate has been revoked (is on a CRL)" |
| 4779 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4780 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4781 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4782 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4783 | ca_file=data_files/test-ca.crt \ |
| 4784 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4785 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4786 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4787 | 1 \ |
| 4788 | -S "skip write certificate request" \ |
| 4789 | -C "skip parse certificate request" \ |
| 4790 | -c "got a certificate request" \ |
| 4791 | -C "skip write certificate" \ |
| 4792 | -C "skip write certificate verify" \ |
| 4793 | -S "skip parse certificate verify" \ |
| 4794 | -s "x509_verify_cert() returned" \ |
| 4795 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4796 | -s "The certificate has been revoked (is on a CRL)" |
| 4797 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4798 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4799 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4800 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4801 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4802 | "$P_CLI nbio=2 tickets=0" \ |
| 4803 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4804 | -S "mbedtls_ssl_handshake returned" \ |
| 4805 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4806 | -c "Read from server: .* bytes read" |
| 4807 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4808 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4809 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4810 | "$P_CLI nbio=2 tickets=0" \ |
| 4811 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4812 | -S "mbedtls_ssl_handshake returned" \ |
| 4813 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4814 | -c "Read from server: .* bytes read" |
| 4815 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4816 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4817 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4818 | "$P_CLI nbio=2 tickets=1" \ |
| 4819 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4820 | -S "mbedtls_ssl_handshake returned" \ |
| 4821 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4822 | -c "Read from server: .* bytes read" |
| 4823 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4824 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4825 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4826 | "$P_CLI nbio=2 tickets=1" \ |
| 4827 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4828 | -S "mbedtls_ssl_handshake returned" \ |
| 4829 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4830 | -c "Read from server: .* bytes read" |
| 4831 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4832 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4833 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4834 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4835 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4836 | -S "mbedtls_ssl_handshake returned" \ |
| 4837 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4838 | -c "Read from server: .* bytes read" |
| 4839 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4840 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4841 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4842 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4843 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4844 | -S "mbedtls_ssl_handshake returned" \ |
| 4845 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4846 | -c "Read from server: .* bytes read" |
| 4847 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4848 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4849 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4850 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4851 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4852 | -S "mbedtls_ssl_handshake returned" \ |
| 4853 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4854 | -c "Read from server: .* bytes read" |
| 4855 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4856 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4857 | |
| 4858 | run_test "Event-driven I/O: basic handshake" \ |
| 4859 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4860 | "$P_CLI event=1 tickets=0" \ |
| 4861 | 0 \ |
| 4862 | -S "mbedtls_ssl_handshake returned" \ |
| 4863 | -C "mbedtls_ssl_handshake returned" \ |
| 4864 | -c "Read from server: .* bytes read" |
| 4865 | |
| 4866 | run_test "Event-driven I/O: client auth" \ |
| 4867 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4868 | "$P_CLI event=1 tickets=0" \ |
| 4869 | 0 \ |
| 4870 | -S "mbedtls_ssl_handshake returned" \ |
| 4871 | -C "mbedtls_ssl_handshake returned" \ |
| 4872 | -c "Read from server: .* bytes read" |
| 4873 | |
| 4874 | run_test "Event-driven I/O: ticket" \ |
| 4875 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4876 | "$P_CLI event=1 tickets=1" \ |
| 4877 | 0 \ |
| 4878 | -S "mbedtls_ssl_handshake returned" \ |
| 4879 | -C "mbedtls_ssl_handshake returned" \ |
| 4880 | -c "Read from server: .* bytes read" |
| 4881 | |
| 4882 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4883 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4884 | "$P_CLI event=1 tickets=1" \ |
| 4885 | 0 \ |
| 4886 | -S "mbedtls_ssl_handshake returned" \ |
| 4887 | -C "mbedtls_ssl_handshake returned" \ |
| 4888 | -c "Read from server: .* bytes read" |
| 4889 | |
| 4890 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4891 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4892 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4893 | 0 \ |
| 4894 | -S "mbedtls_ssl_handshake returned" \ |
| 4895 | -C "mbedtls_ssl_handshake returned" \ |
| 4896 | -c "Read from server: .* bytes read" |
| 4897 | |
| 4898 | run_test "Event-driven I/O: ticket + resume" \ |
| 4899 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4900 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4901 | 0 \ |
| 4902 | -S "mbedtls_ssl_handshake returned" \ |
| 4903 | -C "mbedtls_ssl_handshake returned" \ |
| 4904 | -c "Read from server: .* bytes read" |
| 4905 | |
| 4906 | run_test "Event-driven I/O: session-id resume" \ |
| 4907 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4908 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4909 | 0 \ |
| 4910 | -S "mbedtls_ssl_handshake returned" \ |
| 4911 | -C "mbedtls_ssl_handshake returned" \ |
| 4912 | -c "Read from server: .* bytes read" |
| 4913 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4914 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4915 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4916 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4917 | 0 \ |
| 4918 | -c "Read from server: .* bytes read" |
| 4919 | |
| 4920 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4921 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4922 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4923 | 0 \ |
| 4924 | -c "Read from server: .* bytes read" |
| 4925 | |
| 4926 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4927 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4928 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4929 | 0 \ |
| 4930 | -c "Read from server: .* bytes read" |
| 4931 | |
| 4932 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4933 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4934 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4935 | 0 \ |
| 4936 | -c "Read from server: .* bytes read" |
| 4937 | |
| 4938 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4939 | "$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] | 4940 | "$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] | 4941 | 0 \ |
| 4942 | -c "Read from server: .* bytes read" |
| 4943 | |
| 4944 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4945 | "$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] | 4946 | "$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] | 4947 | 0 \ |
| 4948 | -c "Read from server: .* bytes read" |
| 4949 | |
| 4950 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4951 | "$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] | 4952 | "$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] | 4953 | 0 \ |
| 4954 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4955 | |
| 4956 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4957 | # During session resumption, the client will send its ApplicationData record |
| 4958 | # within the same datagram as the Finished messages. In this situation, the |
| 4959 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4960 | # because the ApplicationData request has already been queued internally. |
| 4961 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4962 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4963 | "$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] | 4964 | "$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] | 4965 | 0 \ |
| 4966 | -c "Read from server: .* bytes read" |
| 4967 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4968 | # Tests for version negotiation |
| 4969 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4970 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4971 | "$P_SRV" \ |
| 4972 | "$P_CLI" \ |
| 4973 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4974 | -S "mbedtls_ssl_handshake returned" \ |
| 4975 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4976 | -s "Protocol is TLSv1.2" \ |
| 4977 | -c "Protocol is TLSv1.2" |
| 4978 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 4979 | run_test "Not supported version check: cli TLS 1.0" \ |
| 4980 | "$P_SRV" \ |
| 4981 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 4982 | 1 \ |
| 4983 | -s "Handshake protocol not within min/max boundaries" \ |
| 4984 | -c "Error in protocol version" \ |
| 4985 | -S "Protocol is TLSv1.0" \ |
| 4986 | -C "Handshake was completed" |
| 4987 | |
| 4988 | run_test "Not supported version check: cli TLS 1.1" \ |
| 4989 | "$P_SRV" \ |
| 4990 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 4991 | 1 \ |
| 4992 | -s "Handshake protocol not within min/max boundaries" \ |
| 4993 | -c "Error in protocol version" \ |
| 4994 | -S "Protocol is TLSv1.1" \ |
| 4995 | -C "Handshake was completed" |
| 4996 | |
| 4997 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 4998 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 4999 | "$P_CLI" \ |
| 5000 | 1 \ |
| 5001 | -s "Error in protocol version" \ |
| 5002 | -c "Handshake protocol not within min/max boundaries" \ |
| 5003 | -S "Version: TLS1.0" \ |
| 5004 | -C "Protocol is TLSv1.0" |
| 5005 | |
| 5006 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 5007 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 5008 | "$P_CLI" \ |
| 5009 | 1 \ |
| 5010 | -s "Error in protocol version" \ |
| 5011 | -c "Handshake protocol not within min/max boundaries" \ |
| 5012 | -S "Version: TLS1.1" \ |
| 5013 | -C "Protocol is TLSv1.1" |
| 5014 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5015 | # Tests for ALPN extension |
| 5016 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5017 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5018 | "$P_SRV debug_level=3" \ |
| 5019 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5020 | 0 \ |
| 5021 | -C "client hello, adding alpn extension" \ |
| 5022 | -S "found alpn extension" \ |
| 5023 | -C "got an alert message, type: \\[2:120]" \ |
| 5024 | -S "server hello, adding alpn extension" \ |
| 5025 | -C "found alpn extension " \ |
| 5026 | -C "Application Layer Protocol is" \ |
| 5027 | -S "Application Layer Protocol is" |
| 5028 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5029 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5030 | "$P_SRV debug_level=3" \ |
| 5031 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5032 | 0 \ |
| 5033 | -c "client hello, adding alpn extension" \ |
| 5034 | -s "found alpn extension" \ |
| 5035 | -C "got an alert message, type: \\[2:120]" \ |
| 5036 | -S "server hello, adding alpn extension" \ |
| 5037 | -C "found alpn extension " \ |
| 5038 | -c "Application Layer Protocol is (none)" \ |
| 5039 | -S "Application Layer Protocol is" |
| 5040 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5041 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5042 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5043 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5044 | 0 \ |
| 5045 | -C "client hello, adding alpn extension" \ |
| 5046 | -S "found alpn extension" \ |
| 5047 | -C "got an alert message, type: \\[2:120]" \ |
| 5048 | -S "server hello, adding alpn extension" \ |
| 5049 | -C "found alpn extension " \ |
| 5050 | -C "Application Layer Protocol is" \ |
| 5051 | -s "Application Layer Protocol is (none)" |
| 5052 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5053 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5054 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5055 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5056 | 0 \ |
| 5057 | -c "client hello, adding alpn extension" \ |
| 5058 | -s "found alpn extension" \ |
| 5059 | -C "got an alert message, type: \\[2:120]" \ |
| 5060 | -s "server hello, adding alpn extension" \ |
| 5061 | -c "found alpn extension" \ |
| 5062 | -c "Application Layer Protocol is abc" \ |
| 5063 | -s "Application Layer Protocol is abc" |
| 5064 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5065 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5066 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5067 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5068 | 0 \ |
| 5069 | -c "client hello, adding alpn extension" \ |
| 5070 | -s "found alpn extension" \ |
| 5071 | -C "got an alert message, type: \\[2:120]" \ |
| 5072 | -s "server hello, adding alpn extension" \ |
| 5073 | -c "found alpn extension" \ |
| 5074 | -c "Application Layer Protocol is abc" \ |
| 5075 | -s "Application Layer Protocol is abc" |
| 5076 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5077 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5078 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5079 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5080 | 0 \ |
| 5081 | -c "client hello, adding alpn extension" \ |
| 5082 | -s "found alpn extension" \ |
| 5083 | -C "got an alert message, type: \\[2:120]" \ |
| 5084 | -s "server hello, adding alpn extension" \ |
| 5085 | -c "found alpn extension" \ |
| 5086 | -c "Application Layer Protocol is 1234" \ |
| 5087 | -s "Application Layer Protocol is 1234" |
| 5088 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5089 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5090 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5091 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5092 | 1 \ |
| 5093 | -c "client hello, adding alpn extension" \ |
| 5094 | -s "found alpn extension" \ |
| 5095 | -c "got an alert message, type: \\[2:120]" \ |
| 5096 | -S "server hello, adding alpn extension" \ |
| 5097 | -C "found alpn extension" \ |
| 5098 | -C "Application Layer Protocol is 1234" \ |
| 5099 | -S "Application Layer Protocol is 1234" |
| 5100 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5101 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5102 | # Tests for keyUsage in leaf certificates, part 1: |
| 5103 | # server-side certificate/suite selection |
| 5104 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5105 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5106 | "$P_SRV key_file=data_files/server2.key \ |
| 5107 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5108 | "$P_CLI" \ |
| 5109 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5110 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5111 | |
| 5112 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5113 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5114 | "$P_SRV key_file=data_files/server2.key \ |
| 5115 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5116 | "$P_CLI" \ |
| 5117 | 0 \ |
| 5118 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5119 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5120 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5121 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5122 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5123 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5124 | 1 \ |
| 5125 | -C "Ciphersuite is " |
| 5126 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5127 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5128 | "$P_SRV key_file=data_files/server5.key \ |
| 5129 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5130 | "$P_CLI" \ |
| 5131 | 0 \ |
| 5132 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5133 | |
| 5134 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5135 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5136 | "$P_SRV key_file=data_files/server5.key \ |
| 5137 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5138 | "$P_CLI" \ |
| 5139 | 0 \ |
| 5140 | -c "Ciphersuite is TLS-ECDH-" |
| 5141 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5142 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5143 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5144 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5145 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5146 | 1 \ |
| 5147 | -C "Ciphersuite is " |
| 5148 | |
| 5149 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5150 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5151 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5152 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, 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_ke.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-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+KeyEncipherment, DHE-RSA: OK" \ |
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_ke.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-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5167 | 0 \ |
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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5172 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5173 | "$O_SRV -key data_files/server2.key \ |
| 5174 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5175 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5176 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5177 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5178 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5179 | -C "Processing of the Certificate handshake message failed" \ |
| 5180 | -c "Ciphersuite is TLS-" |
| 5181 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5182 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5183 | "$O_SRV -key data_files/server2.key \ |
| 5184 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5185 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5186 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5187 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5188 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5189 | -c "Processing of the Certificate handshake message failed" \ |
| 5190 | -C "Ciphersuite is TLS-" |
| 5191 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5192 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5193 | "$O_SRV -key data_files/server2.key \ |
| 5194 | -cert data_files/server2.ku-ke.crt" \ |
| 5195 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5196 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5197 | 0 \ |
| 5198 | -c "bad certificate (usage extensions)" \ |
| 5199 | -C "Processing of the Certificate handshake message failed" \ |
| 5200 | -c "Ciphersuite is TLS-" \ |
| 5201 | -c "! Usage does not match the keyUsage extension" |
| 5202 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5203 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5204 | "$O_SRV -key data_files/server2.key \ |
| 5205 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5206 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5207 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5208 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5209 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5210 | -C "Processing of the Certificate handshake message failed" \ |
| 5211 | -c "Ciphersuite is TLS-" |
| 5212 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5213 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5214 | "$O_SRV -key data_files/server2.key \ |
| 5215 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5216 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5217 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5218 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5219 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5220 | -c "Processing of the Certificate handshake message failed" \ |
| 5221 | -C "Ciphersuite is TLS-" |
| 5222 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5223 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5224 | "$O_SRV -key data_files/server2.key \ |
| 5225 | -cert data_files/server2.ku-ds.crt" \ |
| 5226 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5227 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5228 | 0 \ |
| 5229 | -c "bad certificate (usage extensions)" \ |
| 5230 | -C "Processing of the Certificate handshake message failed" \ |
| 5231 | -c "Ciphersuite is TLS-" \ |
| 5232 | -c "! Usage does not match the keyUsage extension" |
| 5233 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5234 | # Tests for keyUsage in leaf certificates, part 3: |
| 5235 | # server-side checking of client cert |
| 5236 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5237 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5238 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5239 | "$O_CLI -key data_files/server2.key \ |
| 5240 | -cert data_files/server2.ku-ds.crt" \ |
| 5241 | 0 \ |
| 5242 | -S "bad certificate (usage extensions)" \ |
| 5243 | -S "Processing of the Certificate handshake message failed" |
| 5244 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5245 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5246 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5247 | "$O_CLI -key data_files/server2.key \ |
| 5248 | -cert data_files/server2.ku-ke.crt" \ |
| 5249 | 0 \ |
| 5250 | -s "bad certificate (usage extensions)" \ |
| 5251 | -S "Processing of the Certificate handshake message failed" |
| 5252 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5253 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5254 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5255 | "$O_CLI -key data_files/server2.key \ |
| 5256 | -cert data_files/server2.ku-ke.crt" \ |
| 5257 | 1 \ |
| 5258 | -s "bad certificate (usage extensions)" \ |
| 5259 | -s "Processing of the Certificate handshake message failed" |
| 5260 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5261 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5262 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5263 | "$O_CLI -key data_files/server5.key \ |
| 5264 | -cert data_files/server5.ku-ds.crt" \ |
| 5265 | 0 \ |
| 5266 | -S "bad certificate (usage extensions)" \ |
| 5267 | -S "Processing of the Certificate handshake message failed" |
| 5268 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5269 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5270 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5271 | "$O_CLI -key data_files/server5.key \ |
| 5272 | -cert data_files/server5.ku-ka.crt" \ |
| 5273 | 0 \ |
| 5274 | -s "bad certificate (usage extensions)" \ |
| 5275 | -S "Processing of the Certificate handshake message failed" |
| 5276 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5277 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5278 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5279 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5280 | "$P_SRV key_file=data_files/server5.key \ |
| 5281 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5282 | "$P_CLI" \ |
| 5283 | 0 |
| 5284 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5285 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5286 | "$P_SRV key_file=data_files/server5.key \ |
| 5287 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5288 | "$P_CLI" \ |
| 5289 | 0 |
| 5290 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5291 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5292 | "$P_SRV key_file=data_files/server5.key \ |
| 5293 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5294 | "$P_CLI" \ |
| 5295 | 0 |
| 5296 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5297 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5298 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5299 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5300 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5301 | 1 |
| 5302 | |
| 5303 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5304 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5305 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5306 | "$O_SRV -key data_files/server5.key \ |
| 5307 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5308 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5309 | 0 \ |
| 5310 | -C "bad certificate (usage extensions)" \ |
| 5311 | -C "Processing of the Certificate handshake message failed" \ |
| 5312 | -c "Ciphersuite is TLS-" |
| 5313 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5314 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5315 | "$O_SRV -key data_files/server5.key \ |
| 5316 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5317 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5318 | 0 \ |
| 5319 | -C "bad certificate (usage extensions)" \ |
| 5320 | -C "Processing of the Certificate handshake message failed" \ |
| 5321 | -c "Ciphersuite is TLS-" |
| 5322 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5323 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5324 | "$O_SRV -key data_files/server5.key \ |
| 5325 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5326 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5327 | 0 \ |
| 5328 | -C "bad certificate (usage extensions)" \ |
| 5329 | -C "Processing of the Certificate handshake message failed" \ |
| 5330 | -c "Ciphersuite is TLS-" |
| 5331 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5332 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5333 | "$O_SRV -key data_files/server5.key \ |
| 5334 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5335 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5336 | 1 \ |
| 5337 | -c "bad certificate (usage extensions)" \ |
| 5338 | -c "Processing of the Certificate handshake message failed" \ |
| 5339 | -C "Ciphersuite is TLS-" |
| 5340 | |
| 5341 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5342 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5343 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5344 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5345 | "$O_CLI -key data_files/server5.key \ |
| 5346 | -cert data_files/server5.eku-cli.crt" \ |
| 5347 | 0 \ |
| 5348 | -S "bad certificate (usage extensions)" \ |
| 5349 | -S "Processing of the Certificate handshake message failed" |
| 5350 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5351 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5352 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5353 | "$O_CLI -key data_files/server5.key \ |
| 5354 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5355 | 0 \ |
| 5356 | -S "bad certificate (usage extensions)" \ |
| 5357 | -S "Processing of the Certificate handshake message failed" |
| 5358 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5359 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5360 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5361 | "$O_CLI -key data_files/server5.key \ |
| 5362 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5363 | 0 \ |
| 5364 | -S "bad certificate (usage extensions)" \ |
| 5365 | -S "Processing of the Certificate handshake message failed" |
| 5366 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5367 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5368 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5369 | "$O_CLI -key data_files/server5.key \ |
| 5370 | -cert data_files/server5.eku-cs.crt" \ |
| 5371 | 0 \ |
| 5372 | -s "bad certificate (usage extensions)" \ |
| 5373 | -S "Processing of the Certificate handshake message failed" |
| 5374 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5375 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5376 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5377 | "$O_CLI -key data_files/server5.key \ |
| 5378 | -cert data_files/server5.eku-cs.crt" \ |
| 5379 | 1 \ |
| 5380 | -s "bad certificate (usage extensions)" \ |
| 5381 | -s "Processing of the Certificate handshake message failed" |
| 5382 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5383 | # Tests for DHM parameters loading |
| 5384 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5385 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5386 | "$P_SRV" \ |
| 5387 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5388 | debug_level=3" \ |
| 5389 | 0 \ |
| 5390 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5391 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5392 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5393 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5394 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5395 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5396 | debug_level=3" \ |
| 5397 | 0 \ |
| 5398 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5399 | -c "value of 'DHM: G ' (2 bits)" |
| 5400 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5401 | # Tests for DHM client-side size checking |
| 5402 | |
| 5403 | run_test "DHM size: server default, client default, OK" \ |
| 5404 | "$P_SRV" \ |
| 5405 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5406 | debug_level=1" \ |
| 5407 | 0 \ |
| 5408 | -C "DHM prime too short:" |
| 5409 | |
| 5410 | run_test "DHM size: server default, client 2048, OK" \ |
| 5411 | "$P_SRV" \ |
| 5412 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5413 | debug_level=1 dhmlen=2048" \ |
| 5414 | 0 \ |
| 5415 | -C "DHM prime too short:" |
| 5416 | |
| 5417 | run_test "DHM size: server 1024, client default, OK" \ |
| 5418 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5419 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5420 | debug_level=1" \ |
| 5421 | 0 \ |
| 5422 | -C "DHM prime too short:" |
| 5423 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5424 | run_test "DHM size: server 999, client 999, OK" \ |
| 5425 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5426 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5427 | debug_level=1 dhmlen=999" \ |
| 5428 | 0 \ |
| 5429 | -C "DHM prime too short:" |
| 5430 | |
| 5431 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5432 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5433 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5434 | debug_level=1 dhmlen=1000" \ |
| 5435 | 0 \ |
| 5436 | -C "DHM prime too short:" |
| 5437 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5438 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5439 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5440 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5441 | debug_level=1" \ |
| 5442 | 1 \ |
| 5443 | -c "DHM prime too short:" |
| 5444 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5445 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5446 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5447 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5448 | debug_level=1 dhmlen=1001" \ |
| 5449 | 1 \ |
| 5450 | -c "DHM prime too short:" |
| 5451 | |
| 5452 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5453 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5454 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5455 | debug_level=1 dhmlen=1000" \ |
| 5456 | 1 \ |
| 5457 | -c "DHM prime too short:" |
| 5458 | |
| 5459 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5460 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5461 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5462 | debug_level=1 dhmlen=999" \ |
| 5463 | 1 \ |
| 5464 | -c "DHM prime too short:" |
| 5465 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5466 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5467 | "$P_SRV" \ |
| 5468 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5469 | debug_level=1 dhmlen=2049" \ |
| 5470 | 1 \ |
| 5471 | -c "DHM prime too short:" |
| 5472 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5473 | # Tests for PSK callback |
| 5474 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5475 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5476 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5477 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5478 | psk_identity=foo psk=abc123" \ |
| 5479 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5480 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5481 | -S "SSL - Unknown identity received" \ |
| 5482 | -S "SSL - Verification of the message MAC failed" |
| 5483 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5484 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5485 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5486 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5487 | "$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] | 5488 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5489 | 0 \ |
| 5490 | -c "skip PMS generation for opaque PSK"\ |
| 5491 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5492 | -C "session hash for extended master secret"\ |
| 5493 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5494 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5495 | -S "SSL - Unknown identity received" \ |
| 5496 | -S "SSL - Verification of the message MAC failed" |
| 5497 | |
| 5498 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5499 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5500 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5501 | "$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] | 5502 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5503 | 0 \ |
| 5504 | -c "skip PMS generation for opaque PSK"\ |
| 5505 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5506 | -C "session hash for extended master secret"\ |
| 5507 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5508 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5509 | -S "SSL - Unknown identity received" \ |
| 5510 | -S "SSL - Verification of the message MAC failed" |
| 5511 | |
| 5512 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5513 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5514 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5515 | "$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] | 5516 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5517 | 0 \ |
| 5518 | -c "skip PMS generation for opaque PSK"\ |
| 5519 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5520 | -c "session hash for extended master secret"\ |
| 5521 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5522 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5523 | -S "SSL - Unknown identity received" \ |
| 5524 | -S "SSL - Verification of the message MAC failed" |
| 5525 | |
| 5526 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5527 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5528 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5529 | "$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] | 5530 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5531 | 0 \ |
| 5532 | -c "skip PMS generation for opaque PSK"\ |
| 5533 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5534 | -c "session hash for extended master secret"\ |
| 5535 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5536 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5537 | -S "SSL - Unknown identity received" \ |
| 5538 | -S "SSL - Verification of the message MAC failed" |
| 5539 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5540 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5541 | 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] | 5542 | "$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] | 5543 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5544 | psk_identity=foo psk=abc123" \ |
| 5545 | 0 \ |
| 5546 | -C "skip PMS generation for opaque PSK"\ |
| 5547 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5548 | -C "session hash for extended master secret"\ |
| 5549 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5550 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5551 | -S "SSL - Unknown identity received" \ |
| 5552 | -S "SSL - Verification of the message MAC failed" |
| 5553 | |
| 5554 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5555 | 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] | 5556 | "$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] | 5557 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5558 | psk_identity=foo psk=abc123" \ |
| 5559 | 0 \ |
| 5560 | -C "skip PMS generation for opaque PSK"\ |
| 5561 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5562 | -C "session hash for extended master secret"\ |
| 5563 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5564 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5565 | -S "SSL - Unknown identity received" \ |
| 5566 | -S "SSL - Verification of the message MAC failed" |
| 5567 | |
| 5568 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5569 | 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] | 5570 | "$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] | 5571 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5572 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5573 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5574 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5575 | -c "session hash for extended master secret"\ |
| 5576 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5577 | -C "skip PMS generation for opaque PSK"\ |
| 5578 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5579 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5580 | -S "SSL - Unknown identity received" \ |
| 5581 | -S "SSL - Verification of the message MAC failed" |
| 5582 | |
| 5583 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5584 | 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] | 5585 | "$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] | 5586 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5587 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5588 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5589 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5590 | -c "session hash for extended master secret"\ |
| 5591 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5592 | -C "skip PMS generation for opaque PSK"\ |
| 5593 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5594 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5595 | -S "SSL - Unknown identity received" \ |
| 5596 | -S "SSL - Verification of the message MAC failed" |
| 5597 | |
| 5598 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5599 | 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] | 5600 | "$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] | 5601 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5602 | psk_identity=def psk=beef" \ |
| 5603 | 0 \ |
| 5604 | -C "skip PMS generation for opaque PSK"\ |
| 5605 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5606 | -C "session hash for extended master secret"\ |
| 5607 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5608 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5609 | -S "SSL - Unknown identity received" \ |
| 5610 | -S "SSL - Verification of the message MAC failed" |
| 5611 | |
| 5612 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5613 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5614 | "$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] | 5615 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5616 | psk_identity=def psk=beef" \ |
| 5617 | 0 \ |
| 5618 | -C "skip PMS generation for opaque PSK"\ |
| 5619 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5620 | -C "session hash for extended master secret"\ |
| 5621 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5622 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5623 | -S "SSL - Unknown identity received" \ |
| 5624 | -S "SSL - Verification of the message MAC failed" |
| 5625 | |
| 5626 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5627 | 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] | 5628 | "$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] | 5629 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5630 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5631 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5632 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5633 | -c "session hash for extended master secret"\ |
| 5634 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5635 | -C "skip PMS generation for opaque PSK"\ |
| 5636 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5637 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5638 | -S "SSL - Unknown identity received" \ |
| 5639 | -S "SSL - Verification of the message MAC failed" |
| 5640 | |
| 5641 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5642 | 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] | 5643 | "$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] | 5644 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5645 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5646 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5647 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5648 | -c "session hash for extended master secret"\ |
| 5649 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5650 | -C "skip PMS generation for opaque PSK"\ |
| 5651 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5652 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5653 | -S "SSL - Unknown identity received" \ |
| 5654 | -S "SSL - Verification of the message MAC failed" |
| 5655 | |
| 5656 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5657 | 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] | 5658 | "$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] | 5659 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5660 | psk_identity=def psk=beef" \ |
| 5661 | 0 \ |
| 5662 | -C "skip PMS generation for opaque PSK"\ |
| 5663 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5664 | -C "session hash for extended master secret"\ |
| 5665 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5666 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5667 | -S "SSL - Unknown identity received" \ |
| 5668 | -S "SSL - Verification of the message MAC failed" |
| 5669 | |
| 5670 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5671 | 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] | 5672 | "$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] | 5673 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5674 | psk_identity=def psk=beef" \ |
| 5675 | 0 \ |
| 5676 | -C "skip PMS generation for opaque PSK"\ |
| 5677 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5678 | -C "session hash for extended master secret"\ |
| 5679 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5680 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5681 | -S "SSL - Unknown identity received" \ |
| 5682 | -S "SSL - Verification of the message MAC failed" |
| 5683 | |
| 5684 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5685 | 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] | 5686 | "$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] | 5687 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5688 | psk_identity=def psk=beef" \ |
| 5689 | 0 \ |
| 5690 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5691 | -C "session hash for extended master secret"\ |
| 5692 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5693 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5694 | -S "SSL - Unknown identity received" \ |
| 5695 | -S "SSL - Verification of the message MAC failed" |
| 5696 | |
| 5697 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5698 | 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] | 5699 | "$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] | 5700 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5701 | psk_identity=def psk=beef" \ |
| 5702 | 0 \ |
| 5703 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5704 | -C "session hash for extended master secret"\ |
| 5705 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5706 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5707 | -S "SSL - Unknown identity received" \ |
| 5708 | -S "SSL - Verification of the message MAC failed" |
| 5709 | |
| 5710 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5711 | 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] | 5712 | "$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] | 5713 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5714 | psk_identity=def psk=beef" \ |
| 5715 | 1 \ |
| 5716 | -s "SSL - Verification of the message MAC failed" |
| 5717 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5718 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5719 | "$P_SRV" \ |
| 5720 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5721 | psk_identity=foo psk=abc123" \ |
| 5722 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5723 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5724 | -S "SSL - Unknown identity received" \ |
| 5725 | -S "SSL - Verification of the message MAC failed" |
| 5726 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5727 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5728 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5729 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5730 | psk_identity=foo psk=abc123" \ |
| 5731 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5732 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5733 | -s "SSL - Unknown identity received" \ |
| 5734 | -S "SSL - Verification of the message MAC failed" |
| 5735 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5736 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5737 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5738 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5739 | psk_identity=abc psk=dead" \ |
| 5740 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5741 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5742 | -S "SSL - Unknown identity received" \ |
| 5743 | -S "SSL - Verification of the message MAC failed" |
| 5744 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5745 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5746 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5747 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5748 | psk_identity=def psk=beef" \ |
| 5749 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5750 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5751 | -S "SSL - Unknown identity received" \ |
| 5752 | -S "SSL - Verification of the message MAC failed" |
| 5753 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5754 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5755 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5756 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5757 | psk_identity=ghi psk=beef" \ |
| 5758 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5759 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5760 | -s "SSL - Unknown identity received" \ |
| 5761 | -S "SSL - Verification of the message MAC failed" |
| 5762 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5763 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5764 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5765 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5766 | psk_identity=abc psk=beef" \ |
| 5767 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5768 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5769 | -S "SSL - Unknown identity received" \ |
| 5770 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5771 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5772 | # Tests for EC J-PAKE |
| 5773 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5774 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5775 | run_test "ECJPAKE: client not configured" \ |
| 5776 | "$P_SRV debug_level=3" \ |
| 5777 | "$P_CLI debug_level=3" \ |
| 5778 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5779 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5780 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5781 | -S "found ecjpake kkpp extension" \ |
| 5782 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5783 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5784 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5785 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5786 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5787 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5788 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5789 | run_test "ECJPAKE: server not configured" \ |
| 5790 | "$P_SRV debug_level=3" \ |
| 5791 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5792 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5793 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5794 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5795 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5796 | -s "found ecjpake kkpp extension" \ |
| 5797 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5798 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5799 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5800 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5801 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5802 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5803 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5804 | run_test "ECJPAKE: working, TLS" \ |
| 5805 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5806 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5807 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5808 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5809 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5810 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5811 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5812 | -s "found ecjpake kkpp extension" \ |
| 5813 | -S "skip ecjpake kkpp extension" \ |
| 5814 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5815 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5816 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5817 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5818 | -S "SSL - Verification of the message MAC failed" |
| 5819 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5820 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5821 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5822 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5823 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5824 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5825 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5826 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5827 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5828 | -s "SSL - Verification of the message MAC failed" |
| 5829 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5830 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5831 | run_test "ECJPAKE: working, DTLS" \ |
| 5832 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5833 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5834 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5835 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5836 | -c "re-using cached ecjpake parameters" \ |
| 5837 | -S "SSL - Verification of the message MAC failed" |
| 5838 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5839 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5840 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5841 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5842 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5843 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5844 | 0 \ |
| 5845 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5846 | -S "SSL - Verification of the message MAC failed" |
| 5847 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5848 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5849 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5850 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5851 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5852 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5853 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5854 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5855 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5856 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5857 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5858 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5859 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5860 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5861 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5862 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5863 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5864 | 0 |
| 5865 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5866 | # Test for ClientHello without extensions |
| 5867 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5868 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5869 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5870 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5871 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5872 | 0 \ |
| 5873 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5874 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5875 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5876 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5877 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5878 | "$P_SRV" \ |
| 5879 | "$P_CLI request_size=100" \ |
| 5880 | 0 \ |
| 5881 | -s "Read from client: 100 bytes read$" |
| 5882 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5883 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5884 | "$P_SRV" \ |
| 5885 | "$P_CLI request_size=500" \ |
| 5886 | 0 \ |
| 5887 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5888 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5889 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5890 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5891 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5892 | "$P_SRV" \ |
| 5893 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5894 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5895 | 0 \ |
| 5896 | -s "Read from client: 1 bytes read" |
| 5897 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5898 | 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] | 5899 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5900 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5901 | 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] | 5902 | 0 \ |
| 5903 | -s "Read from client: 1 bytes read" |
| 5904 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5905 | 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] | 5906 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5907 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5908 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5909 | 0 \ |
| 5910 | -s "Read from client: 1 bytes read" |
| 5911 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5912 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5913 | "$P_SRV" \ |
| 5914 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5915 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5916 | 0 \ |
| 5917 | -s "Read from client: 1 bytes read" |
| 5918 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5919 | 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] | 5920 | "$P_SRV" \ |
| 5921 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5922 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5923 | 0 \ |
| 5924 | -s "Read from client: 1 bytes read" |
| 5925 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5926 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5927 | |
| 5928 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5929 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5930 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5931 | "$P_CLI dtls=1 request_size=1 \ |
| 5932 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5933 | 0 \ |
| 5934 | -s "Read from client: 1 bytes read" |
| 5935 | |
| 5936 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5937 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5938 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5939 | "$P_CLI dtls=1 request_size=1 \ |
| 5940 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5941 | 0 \ |
| 5942 | -s "Read from client: 1 bytes read" |
| 5943 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5944 | # Tests for small server packets |
| 5945 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5946 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5947 | "$P_SRV response_size=1" \ |
| 5948 | "$P_CLI force_version=tls1_2 \ |
| 5949 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5950 | 0 \ |
| 5951 | -c "Read from server: 1 bytes read" |
| 5952 | |
| 5953 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5954 | "$P_SRV response_size=1" \ |
| 5955 | "$P_CLI force_version=tls1_2 \ |
| 5956 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5957 | 0 \ |
| 5958 | -c "Read from server: 1 bytes read" |
| 5959 | |
| 5960 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5961 | "$P_SRV response_size=1" \ |
| 5962 | "$P_CLI force_version=tls1_2 \ |
| 5963 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5964 | 0 \ |
| 5965 | -c "Read from server: 1 bytes read" |
| 5966 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5967 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5968 | "$P_SRV response_size=1" \ |
| 5969 | "$P_CLI force_version=tls1_2 \ |
| 5970 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5971 | 0 \ |
| 5972 | -c "Read from server: 1 bytes read" |
| 5973 | |
| 5974 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5975 | "$P_SRV response_size=1" \ |
| 5976 | "$P_CLI force_version=tls1_2 \ |
| 5977 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5978 | 0 \ |
| 5979 | -c "Read from server: 1 bytes read" |
| 5980 | |
| 5981 | # Tests for small server packets in DTLS |
| 5982 | |
| 5983 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5984 | run_test "Small server packet DTLS 1.2" \ |
| 5985 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5986 | "$P_CLI dtls=1 \ |
| 5987 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5988 | 0 \ |
| 5989 | -c "Read from server: 1 bytes read" |
| 5990 | |
| 5991 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5992 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5993 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5994 | "$P_CLI dtls=1 \ |
| 5995 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5996 | 0 \ |
| 5997 | -c "Read from server: 1 bytes read" |
| 5998 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5999 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6000 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6001 | # How many fragments do we expect to write $1 bytes? |
| 6002 | fragments_for_write() { |
| 6003 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6004 | } |
| 6005 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6006 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6007 | "$P_SRV" \ |
| 6008 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6009 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6010 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6011 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6012 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6013 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6014 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6015 | "$P_SRV" \ |
| 6016 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 6017 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6018 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6019 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6020 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6021 | 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] | 6022 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6023 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6024 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6025 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6026 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6027 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6028 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6029 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6030 | "$P_SRV" \ |
| 6031 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6032 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6033 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6034 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6035 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6036 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6037 | 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] | 6038 | "$P_SRV" \ |
| 6039 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6040 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6041 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6042 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6043 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6044 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6045 | # 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] | 6046 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6047 | "$P_SRV response_size=16384" \ |
| 6048 | "$P_CLI force_version=tls1_2 \ |
| 6049 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6050 | 0 \ |
| 6051 | -c "Read from server: 16384 bytes read" |
| 6052 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6053 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6054 | "$P_SRV response_size=16384" \ |
| 6055 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6056 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6057 | 0 \ |
| 6058 | -s "16384 bytes written in 1 fragments" \ |
| 6059 | -c "Read from server: 16384 bytes read" |
| 6060 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6061 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6062 | "$P_SRV response_size=16384" \ |
| 6063 | "$P_CLI force_version=tls1_2 \ |
| 6064 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6065 | 0 \ |
| 6066 | -c "Read from server: 16384 bytes read" |
| 6067 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6068 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6069 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6070 | "$P_CLI force_version=tls1_2 \ |
| 6071 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6072 | 0 \ |
| 6073 | -s "16384 bytes written in 1 fragments" \ |
| 6074 | -c "Read from server: 16384 bytes read" |
| 6075 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6076 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6077 | "$P_SRV response_size=16384" \ |
| 6078 | "$P_CLI force_version=tls1_2 \ |
| 6079 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6080 | 0 \ |
| 6081 | -c "Read from server: 16384 bytes read" |
| 6082 | |
| 6083 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6084 | "$P_SRV response_size=16384" \ |
| 6085 | "$P_CLI force_version=tls1_2 \ |
| 6086 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6087 | 0 \ |
| 6088 | -c "Read from server: 16384 bytes read" |
| 6089 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6090 | # Tests for restartable ECC |
| 6091 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6092 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 6093 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6094 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6095 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6096 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6097 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6098 | "$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] | 6099 | 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] | 6100 | debug_level=1" \ |
| 6101 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6102 | -C "x509_verify_cert.*4b00" \ |
| 6103 | -C "mbedtls_pk_verify.*4b00" \ |
| 6104 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6105 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6106 | |
| 6107 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6108 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6109 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6110 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6111 | "$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] | 6112 | 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] | 6113 | debug_level=1 ec_max_ops=0" \ |
| 6114 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6115 | -C "x509_verify_cert.*4b00" \ |
| 6116 | -C "mbedtls_pk_verify.*4b00" \ |
| 6117 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6118 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6119 | |
| 6120 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6121 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6122 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6123 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6124 | "$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] | 6125 | 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] | 6126 | debug_level=1 ec_max_ops=65535" \ |
| 6127 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6128 | -C "x509_verify_cert.*4b00" \ |
| 6129 | -C "mbedtls_pk_verify.*4b00" \ |
| 6130 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6131 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6132 | |
| 6133 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6134 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6135 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6136 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6137 | "$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] | 6138 | 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] | 6139 | debug_level=1 ec_max_ops=1000" \ |
| 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 | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6145 | |
| 6146 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6147 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6148 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6149 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6150 | crt_file=data_files/server5-badsign.crt \ |
| 6151 | key_file=data_files/server5.key" \ |
| 6152 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6153 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6154 | debug_level=1 ec_max_ops=1000" \ |
| 6155 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6156 | -c "x509_verify_cert.*4b00" \ |
| 6157 | -C "mbedtls_pk_verify.*4b00" \ |
| 6158 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6159 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6160 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6161 | -c "! mbedtls_ssl_handshake returned" \ |
| 6162 | -c "X509 - Certificate verification failed" |
| 6163 | |
| 6164 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6165 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6166 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6167 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6168 | crt_file=data_files/server5-badsign.crt \ |
| 6169 | key_file=data_files/server5.key" \ |
| 6170 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6171 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6172 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6173 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6174 | -c "x509_verify_cert.*4b00" \ |
| 6175 | -c "mbedtls_pk_verify.*4b00" \ |
| 6176 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6177 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6178 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6179 | -C "! mbedtls_ssl_handshake returned" \ |
| 6180 | -C "X509 - Certificate verification failed" |
| 6181 | |
| 6182 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6183 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6184 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6185 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6186 | crt_file=data_files/server5-badsign.crt \ |
| 6187 | key_file=data_files/server5.key" \ |
| 6188 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6189 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6190 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6191 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6192 | -C "x509_verify_cert.*4b00" \ |
| 6193 | -c "mbedtls_pk_verify.*4b00" \ |
| 6194 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6195 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6196 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6197 | -C "! mbedtls_ssl_handshake returned" \ |
| 6198 | -C "X509 - Certificate verification failed" |
| 6199 | |
| 6200 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6201 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6202 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6203 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6204 | "$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] | 6205 | 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] | 6206 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6207 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6208 | -c "x509_verify_cert.*4b00" \ |
| 6209 | -c "mbedtls_pk_verify.*4b00" \ |
| 6210 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6211 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6212 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6213 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6214 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6215 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6216 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6217 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6218 | debug_level=1 ec_max_ops=1000" \ |
| 6219 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6220 | -c "x509_verify_cert.*4b00" \ |
| 6221 | -c "mbedtls_pk_verify.*4b00" \ |
| 6222 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6223 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6224 | |
| 6225 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6226 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6227 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6228 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6229 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6230 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6231 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6232 | -C "x509_verify_cert.*4b00" \ |
| 6233 | -C "mbedtls_pk_verify.*4b00" \ |
| 6234 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6235 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6236 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6237 | # Tests of asynchronous private key support in SSL |
| 6238 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6239 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6240 | run_test "SSL async private: sign, delay=0" \ |
| 6241 | "$P_SRV \ |
| 6242 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6243 | "$P_CLI" \ |
| 6244 | 0 \ |
| 6245 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6246 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6247 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6248 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6249 | run_test "SSL async private: sign, delay=1" \ |
| 6250 | "$P_SRV \ |
| 6251 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6252 | "$P_CLI" \ |
| 6253 | 0 \ |
| 6254 | -s "Async sign callback: using key slot " \ |
| 6255 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6256 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6257 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6258 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6259 | run_test "SSL async private: sign, delay=2" \ |
| 6260 | "$P_SRV \ |
| 6261 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6262 | "$P_CLI" \ |
| 6263 | 0 \ |
| 6264 | -s "Async sign callback: using key slot " \ |
| 6265 | -U "Async sign callback: using key slot " \ |
| 6266 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6267 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6268 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6269 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6270 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6271 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6272 | run_test "SSL async private: sign, SNI" \ |
| 6273 | "$P_SRV debug_level=3 \ |
| 6274 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6275 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6276 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6277 | "$P_CLI server_name=polarssl.example" \ |
| 6278 | 0 \ |
| 6279 | -s "Async sign callback: using key slot " \ |
| 6280 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6281 | -s "parse ServerName extension" \ |
| 6282 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6283 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6284 | |
| 6285 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6286 | run_test "SSL async private: decrypt, delay=0" \ |
| 6287 | "$P_SRV \ |
| 6288 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6289 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6290 | 0 \ |
| 6291 | -s "Async decrypt callback: using key slot " \ |
| 6292 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6293 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6294 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6295 | run_test "SSL async private: decrypt, delay=1" \ |
| 6296 | "$P_SRV \ |
| 6297 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6298 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6299 | 0 \ |
| 6300 | -s "Async decrypt callback: using key slot " \ |
| 6301 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6302 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6303 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6304 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6305 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6306 | "$P_SRV psk=abc123 \ |
| 6307 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6308 | "$P_CLI psk=abc123 \ |
| 6309 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6310 | 0 \ |
| 6311 | -s "Async decrypt callback: using key slot " \ |
| 6312 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6313 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6314 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6315 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6316 | "$P_SRV psk=abc123 \ |
| 6317 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6318 | "$P_CLI psk=abc123 \ |
| 6319 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6320 | 0 \ |
| 6321 | -s "Async decrypt callback: using key slot " \ |
| 6322 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6323 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6324 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6325 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6326 | run_test "SSL async private: sign callback not present" \ |
| 6327 | "$P_SRV \ |
| 6328 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6329 | "$P_CLI; [ \$? -eq 1 ] && |
| 6330 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6331 | 0 \ |
| 6332 | -S "Async sign callback" \ |
| 6333 | -s "! mbedtls_ssl_handshake returned" \ |
| 6334 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6335 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6336 | -s "Successful connection" |
| 6337 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6338 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6339 | run_test "SSL async private: decrypt callback not present" \ |
| 6340 | "$P_SRV debug_level=1 \ |
| 6341 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6342 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6343 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6344 | 0 \ |
| 6345 | -S "Async decrypt callback" \ |
| 6346 | -s "! mbedtls_ssl_handshake returned" \ |
| 6347 | -s "got no RSA private key" \ |
| 6348 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6349 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6350 | |
| 6351 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6352 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6353 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6354 | "$P_SRV \ |
| 6355 | async_operations=s async_private_delay1=1 \ |
| 6356 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6357 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6358 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6359 | 0 \ |
| 6360 | -s "Async sign callback: using key slot 0," \ |
| 6361 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6362 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6363 | |
| 6364 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6365 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6366 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6367 | "$P_SRV \ |
| 6368 | async_operations=s async_private_delay2=1 \ |
| 6369 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6370 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6371 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6372 | 0 \ |
| 6373 | -s "Async sign callback: using key slot 0," \ |
| 6374 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6375 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6376 | |
| 6377 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6378 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6379 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6380 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6381 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6382 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6383 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6384 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6385 | 0 \ |
| 6386 | -s "Async sign callback: using key slot 1," \ |
| 6387 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6388 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6389 | |
| 6390 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6391 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6392 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6393 | "$P_SRV \ |
| 6394 | async_operations=s async_private_delay1=1 \ |
| 6395 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6396 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6397 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6398 | 0 \ |
| 6399 | -s "Async sign callback: no key matches this certificate." |
| 6400 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6401 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6402 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6403 | "$P_SRV \ |
| 6404 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6405 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6406 | "$P_CLI" \ |
| 6407 | 1 \ |
| 6408 | -s "Async sign callback: injected error" \ |
| 6409 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6410 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6411 | -s "! mbedtls_ssl_handshake returned" |
| 6412 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6413 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6414 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6415 | "$P_SRV \ |
| 6416 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6417 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6418 | "$P_CLI" \ |
| 6419 | 1 \ |
| 6420 | -s "Async sign callback: using key slot " \ |
| 6421 | -S "Async resume" \ |
| 6422 | -s "Async cancel" |
| 6423 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6424 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6425 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6426 | "$P_SRV \ |
| 6427 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6428 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6429 | "$P_CLI" \ |
| 6430 | 1 \ |
| 6431 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6432 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6433 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6434 | -s "! mbedtls_ssl_handshake returned" |
| 6435 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6436 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6437 | run_test "SSL async private: decrypt, error in start" \ |
| 6438 | "$P_SRV \ |
| 6439 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6440 | async_private_error=1" \ |
| 6441 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6442 | 1 \ |
| 6443 | -s "Async decrypt callback: injected error" \ |
| 6444 | -S "Async resume" \ |
| 6445 | -S "Async cancel" \ |
| 6446 | -s "! mbedtls_ssl_handshake returned" |
| 6447 | |
| 6448 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6449 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6450 | "$P_SRV \ |
| 6451 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6452 | async_private_error=2" \ |
| 6453 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6454 | 1 \ |
| 6455 | -s "Async decrypt callback: using key slot " \ |
| 6456 | -S "Async resume" \ |
| 6457 | -s "Async cancel" |
| 6458 | |
| 6459 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6460 | run_test "SSL async private: decrypt, error in resume" \ |
| 6461 | "$P_SRV \ |
| 6462 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6463 | async_private_error=3" \ |
| 6464 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6465 | 1 \ |
| 6466 | -s "Async decrypt callback: using key slot " \ |
| 6467 | -s "Async resume callback: decrypt done but injected error" \ |
| 6468 | -S "Async cancel" \ |
| 6469 | -s "! mbedtls_ssl_handshake returned" |
| 6470 | |
| 6471 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6472 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6473 | "$P_SRV \ |
| 6474 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6475 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6476 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6477 | 0 \ |
| 6478 | -s "Async cancel" \ |
| 6479 | -s "! mbedtls_ssl_handshake returned" \ |
| 6480 | -s "Async resume" \ |
| 6481 | -s "Successful connection" |
| 6482 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6483 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6484 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6485 | "$P_SRV \ |
| 6486 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6487 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6488 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6489 | 0 \ |
| 6490 | -s "! mbedtls_ssl_handshake returned" \ |
| 6491 | -s "Async resume" \ |
| 6492 | -s "Successful connection" |
| 6493 | |
| 6494 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6495 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6496 | 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] | 6497 | "$P_SRV \ |
| 6498 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6499 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6500 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6501 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6502 | [ \$? -eq 1 ] && |
| 6503 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6504 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6505 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6506 | -S "Async resume" \ |
| 6507 | -s "Async cancel" \ |
| 6508 | -s "! mbedtls_ssl_handshake returned" \ |
| 6509 | -s "Async sign callback: no key matches this certificate." \ |
| 6510 | -s "Successful connection" |
| 6511 | |
| 6512 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6513 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6514 | 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] | 6515 | "$P_SRV \ |
| 6516 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6517 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6518 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6519 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6520 | [ \$? -eq 1 ] && |
| 6521 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6522 | 0 \ |
| 6523 | -s "Async resume" \ |
| 6524 | -s "! mbedtls_ssl_handshake returned" \ |
| 6525 | -s "Async sign callback: no key matches this certificate." \ |
| 6526 | -s "Successful connection" |
| 6527 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6528 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6529 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6530 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6531 | "$P_SRV \ |
| 6532 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6533 | exchanges=2 renegotiation=1" \ |
| 6534 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6535 | 0 \ |
| 6536 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6537 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6538 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6539 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6540 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6541 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6542 | "$P_SRV \ |
| 6543 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6544 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6545 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6546 | 0 \ |
| 6547 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6548 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6549 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6550 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6551 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6552 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6553 | "$P_SRV \ |
| 6554 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6555 | exchanges=2 renegotiation=1" \ |
| 6556 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6557 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6558 | 0 \ |
| 6559 | -s "Async decrypt callback: using key slot " \ |
| 6560 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6561 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6562 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6563 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6564 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6565 | "$P_SRV \ |
| 6566 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6567 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6568 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6569 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6570 | 0 \ |
| 6571 | -s "Async decrypt callback: using key slot " \ |
| 6572 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6573 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6574 | # Tests for ECC extensions (rfc 4492) |
| 6575 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6576 | requires_config_enabled MBEDTLS_AES_C |
| 6577 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6578 | requires_config_enabled MBEDTLS_SHA256_C |
| 6579 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6580 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6581 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6582 | "$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] | 6583 | 0 \ |
| 6584 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6585 | -C "client hello, adding supported_point_formats extension" \ |
| 6586 | -S "found supported elliptic curves extension" \ |
| 6587 | -S "found supported point formats extension" |
| 6588 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6589 | requires_config_enabled MBEDTLS_AES_C |
| 6590 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6591 | requires_config_enabled MBEDTLS_SHA256_C |
| 6592 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6593 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6594 | "$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] | 6595 | "$P_CLI debug_level=3" \ |
| 6596 | 0 \ |
| 6597 | -C "found supported_point_formats extension" \ |
| 6598 | -S "server hello, supported_point_formats extension" |
| 6599 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6600 | requires_config_enabled MBEDTLS_AES_C |
| 6601 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6602 | requires_config_enabled MBEDTLS_SHA256_C |
| 6603 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6604 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6605 | "$P_SRV debug_level=3" \ |
| 6606 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6607 | 0 \ |
| 6608 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6609 | -c "client hello, adding supported_point_formats extension" \ |
| 6610 | -s "found supported elliptic curves extension" \ |
| 6611 | -s "found supported point formats extension" |
| 6612 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6613 | requires_config_enabled MBEDTLS_AES_C |
| 6614 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6615 | requires_config_enabled MBEDTLS_SHA256_C |
| 6616 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6617 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6618 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6619 | "$P_CLI debug_level=3" \ |
| 6620 | 0 \ |
| 6621 | -c "found supported_point_formats extension" \ |
| 6622 | -s "server hello, supported_point_formats extension" |
| 6623 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6624 | # Tests for DTLS HelloVerifyRequest |
| 6625 | |
| 6626 | run_test "DTLS cookie: enabled" \ |
| 6627 | "$P_SRV dtls=1 debug_level=2" \ |
| 6628 | "$P_CLI dtls=1 debug_level=2" \ |
| 6629 | 0 \ |
| 6630 | -s "cookie verification failed" \ |
| 6631 | -s "cookie verification passed" \ |
| 6632 | -S "cookie verification skipped" \ |
| 6633 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6634 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6635 | -S "SSL - The requested feature is not available" |
| 6636 | |
| 6637 | run_test "DTLS cookie: disabled" \ |
| 6638 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6639 | "$P_CLI dtls=1 debug_level=2" \ |
| 6640 | 0 \ |
| 6641 | -S "cookie verification failed" \ |
| 6642 | -S "cookie verification passed" \ |
| 6643 | -s "cookie verification skipped" \ |
| 6644 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6645 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6646 | -S "SSL - The requested feature is not available" |
| 6647 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6648 | run_test "DTLS cookie: default (failing)" \ |
| 6649 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6650 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6651 | 1 \ |
| 6652 | -s "cookie verification failed" \ |
| 6653 | -S "cookie verification passed" \ |
| 6654 | -S "cookie verification skipped" \ |
| 6655 | -C "received hello verify request" \ |
| 6656 | -S "hello verification requested" \ |
| 6657 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6658 | |
| 6659 | requires_ipv6 |
| 6660 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6661 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6662 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6663 | 0 \ |
| 6664 | -s "cookie verification failed" \ |
| 6665 | -s "cookie verification passed" \ |
| 6666 | -S "cookie verification skipped" \ |
| 6667 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6668 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6669 | -S "SSL - The requested feature is not available" |
| 6670 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6671 | run_test "DTLS cookie: enabled, nbio" \ |
| 6672 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6673 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6674 | 0 \ |
| 6675 | -s "cookie verification failed" \ |
| 6676 | -s "cookie verification passed" \ |
| 6677 | -S "cookie verification skipped" \ |
| 6678 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6679 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6680 | -S "SSL - The requested feature is not available" |
| 6681 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6682 | # Tests for client reconnecting from the same port with DTLS |
| 6683 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6684 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6685 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6686 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6687 | "$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] | 6688 | 0 \ |
| 6689 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6690 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6691 | -S "Client initiated reconnection from same port" |
| 6692 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6693 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6694 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6695 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6696 | "$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] | 6697 | 0 \ |
| 6698 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6699 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6700 | -s "Client initiated reconnection from same port" |
| 6701 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6702 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6703 | 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] | 6704 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6705 | "$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] | 6706 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6707 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6708 | -s "Client initiated reconnection from same port" |
| 6709 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6710 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6711 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6712 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6713 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6714 | 0 \ |
| 6715 | -S "The operation timed out" \ |
| 6716 | -s "Client initiated reconnection from same port" |
| 6717 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6718 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6719 | "$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] | 6720 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6721 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6722 | -s "The operation timed out" \ |
| 6723 | -S "Client initiated reconnection from same port" |
| 6724 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6725 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6726 | -p "$P_PXY inject_clihlo=1" \ |
| 6727 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6728 | "$P_CLI dtls=1 exchanges=2" \ |
| 6729 | 0 \ |
| 6730 | -s "possible client reconnect from the same port" \ |
| 6731 | -S "Client initiated reconnection from same port" |
| 6732 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6733 | # Tests for various cases of client authentication with DTLS |
| 6734 | # (focused on handshake flows and message parsing) |
| 6735 | |
| 6736 | run_test "DTLS client auth: required" \ |
| 6737 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6738 | "$P_CLI dtls=1" \ |
| 6739 | 0 \ |
| 6740 | -s "Verifying peer X.509 certificate... ok" |
| 6741 | |
| 6742 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6743 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6744 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6745 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6746 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6747 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6748 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6749 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6750 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6751 | 0 \ |
| 6752 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6753 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6754 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6755 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6756 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6757 | "$P_CLI dtls=1 psk=abc124" \ |
| 6758 | 1 \ |
| 6759 | -s "SSL - Verification of the message MAC failed" \ |
| 6760 | -c "SSL - A fatal alert message was received from our peer" |
| 6761 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6762 | # Tests for receiving fragmented handshake messages with DTLS |
| 6763 | |
| 6764 | requires_gnutls |
| 6765 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6766 | "$G_SRV -u --mtu 2048 -a" \ |
| 6767 | "$P_CLI dtls=1 debug_level=2" \ |
| 6768 | 0 \ |
| 6769 | -C "found fragmented DTLS handshake message" \ |
| 6770 | -C "error" |
| 6771 | |
| 6772 | requires_gnutls |
| 6773 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6774 | "$G_SRV -u --mtu 512" \ |
| 6775 | "$P_CLI dtls=1 debug_level=2" \ |
| 6776 | 0 \ |
| 6777 | -c "found fragmented DTLS handshake message" \ |
| 6778 | -C "error" |
| 6779 | |
| 6780 | requires_gnutls |
| 6781 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6782 | "$G_SRV -u --mtu 128" \ |
| 6783 | "$P_CLI dtls=1 debug_level=2" \ |
| 6784 | 0 \ |
| 6785 | -c "found fragmented DTLS handshake message" \ |
| 6786 | -C "error" |
| 6787 | |
| 6788 | requires_gnutls |
| 6789 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6790 | "$G_SRV -u --mtu 128" \ |
| 6791 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6792 | 0 \ |
| 6793 | -c "found fragmented DTLS handshake message" \ |
| 6794 | -C "error" |
| 6795 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6796 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6797 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6798 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6799 | "$G_SRV -u --mtu 256" \ |
| 6800 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6801 | 0 \ |
| 6802 | -c "found fragmented DTLS handshake message" \ |
| 6803 | -c "client hello, adding renegotiation extension" \ |
| 6804 | -c "found renegotiation extension" \ |
| 6805 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6806 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6807 | -C "error" \ |
| 6808 | -s "Extra-header:" |
| 6809 | |
| 6810 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6811 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6812 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6813 | "$G_SRV -u --mtu 256" \ |
| 6814 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6815 | 0 \ |
| 6816 | -c "found fragmented DTLS handshake message" \ |
| 6817 | -c "client hello, adding renegotiation extension" \ |
| 6818 | -c "found renegotiation extension" \ |
| 6819 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6820 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6821 | -C "error" \ |
| 6822 | -s "Extra-header:" |
| 6823 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6824 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6825 | "$O_SRV -dtls -mtu 2048" \ |
| 6826 | "$P_CLI dtls=1 debug_level=2" \ |
| 6827 | 0 \ |
| 6828 | -C "found fragmented DTLS handshake message" \ |
| 6829 | -C "error" |
| 6830 | |
| 6831 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6832 | "$O_SRV -dtls -mtu 768" \ |
| 6833 | "$P_CLI dtls=1 debug_level=2" \ |
| 6834 | 0 \ |
| 6835 | -c "found fragmented DTLS handshake message" \ |
| 6836 | -C "error" |
| 6837 | |
| 6838 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6839 | "$O_SRV -dtls -mtu 256" \ |
| 6840 | "$P_CLI dtls=1 debug_level=2" \ |
| 6841 | 0 \ |
| 6842 | -c "found fragmented DTLS handshake message" \ |
| 6843 | -C "error" |
| 6844 | |
| 6845 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6846 | "$O_SRV -dtls -mtu 256" \ |
| 6847 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6848 | 0 \ |
| 6849 | -c "found fragmented DTLS handshake message" \ |
| 6850 | -C "error" |
| 6851 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6852 | # Tests for sending fragmented handshake messages with DTLS |
| 6853 | # |
| 6854 | # Use client auth when we need the client to send large messages, |
| 6855 | # and use large cert chains on both sides too (the long chains we have all use |
| 6856 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6857 | # Sizes reached (UDP payload): |
| 6858 | # - 2037B for server certificate |
| 6859 | # - 1542B for client certificate |
| 6860 | # - 1013B for newsessionticket |
| 6861 | # - all others below 512B |
| 6862 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6863 | |
| 6864 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6865 | requires_config_enabled MBEDTLS_RSA_C |
| 6866 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6867 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6868 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6869 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6870 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6871 | crt_file=data_files/server7_int-ca.crt \ |
| 6872 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6873 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6874 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6875 | "$P_CLI dtls=1 debug_level=2 \ |
| 6876 | crt_file=data_files/server8_int-ca2.crt \ |
| 6877 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6878 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6879 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6880 | 0 \ |
| 6881 | -S "found fragmented DTLS handshake message" \ |
| 6882 | -C "found fragmented DTLS handshake message" \ |
| 6883 | -C "error" |
| 6884 | |
| 6885 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6886 | requires_config_enabled MBEDTLS_RSA_C |
| 6887 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6888 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6889 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6890 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6891 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6892 | crt_file=data_files/server7_int-ca.crt \ |
| 6893 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6894 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6895 | max_frag_len=1024" \ |
| 6896 | "$P_CLI dtls=1 debug_level=2 \ |
| 6897 | crt_file=data_files/server8_int-ca2.crt \ |
| 6898 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6899 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6900 | max_frag_len=2048" \ |
| 6901 | 0 \ |
| 6902 | -S "found fragmented DTLS handshake message" \ |
| 6903 | -c "found fragmented DTLS handshake message" \ |
| 6904 | -C "error" |
| 6905 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6906 | # With the MFL extension, the server has no way of forcing |
| 6907 | # the client to not exceed a certain MTU; hence, the following |
| 6908 | # test can't be replicated with an MTU proxy such as the one |
| 6909 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6910 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6911 | requires_config_enabled MBEDTLS_RSA_C |
| 6912 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6913 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6914 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6915 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6916 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6917 | crt_file=data_files/server7_int-ca.crt \ |
| 6918 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6919 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6920 | max_frag_len=512" \ |
| 6921 | "$P_CLI dtls=1 debug_level=2 \ |
| 6922 | crt_file=data_files/server8_int-ca2.crt \ |
| 6923 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6924 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6925 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6926 | 0 \ |
| 6927 | -S "found fragmented DTLS handshake message" \ |
| 6928 | -c "found fragmented DTLS handshake message" \ |
| 6929 | -C "error" |
| 6930 | |
| 6931 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6932 | requires_config_enabled MBEDTLS_RSA_C |
| 6933 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6934 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6935 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6936 | run_test "DTLS fragmenting: client-initiated, server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6937 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6938 | crt_file=data_files/server7_int-ca.crt \ |
| 6939 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6940 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6941 | max_frag_len=2048" \ |
| 6942 | "$P_CLI dtls=1 debug_level=2 \ |
| 6943 | crt_file=data_files/server8_int-ca2.crt \ |
| 6944 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6945 | hs_timeout=2500-60000 \ |
| 6946 | max_frag_len=1024" \ |
| 6947 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6948 | -S "found fragmented DTLS handshake message" \ |
| 6949 | -c "found fragmented DTLS handshake message" \ |
| 6950 | -C "error" |
| 6951 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6952 | # While not required by the standard defining the MFL extension |
| 6953 | # (according to which it only applies to records, not to datagrams), |
| 6954 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6955 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6956 | # to the peer. |
| 6957 | # The next test checks that no datagrams significantly larger than the |
| 6958 | # negotiated MFL are sent. |
| 6959 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6960 | requires_config_enabled MBEDTLS_RSA_C |
| 6961 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6962 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6963 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6964 | 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] | 6965 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6966 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6967 | crt_file=data_files/server7_int-ca.crt \ |
| 6968 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6969 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6970 | max_frag_len=2048" \ |
| 6971 | "$P_CLI dtls=1 debug_level=2 \ |
| 6972 | crt_file=data_files/server8_int-ca2.crt \ |
| 6973 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6974 | hs_timeout=2500-60000 \ |
| 6975 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6976 | 0 \ |
| 6977 | -S "found fragmented DTLS handshake message" \ |
| 6978 | -c "found fragmented DTLS handshake message" \ |
| 6979 | -C "error" |
| 6980 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6981 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6982 | requires_config_enabled MBEDTLS_RSA_C |
| 6983 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6984 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6985 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6986 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6987 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6988 | crt_file=data_files/server7_int-ca.crt \ |
| 6989 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6990 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6991 | max_frag_len=2048" \ |
| 6992 | "$P_CLI dtls=1 debug_level=2 \ |
| 6993 | crt_file=data_files/server8_int-ca2.crt \ |
| 6994 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6995 | hs_timeout=2500-60000 \ |
| 6996 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6997 | 0 \ |
| 6998 | -s "found fragmented DTLS handshake message" \ |
| 6999 | -c "found fragmented DTLS handshake message" \ |
| 7000 | -C "error" |
| 7001 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7002 | # While not required by the standard defining the MFL extension |
| 7003 | # (according to which it only applies to records, not to datagrams), |
| 7004 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7005 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7006 | # to the peer. |
| 7007 | # The next test checks that no datagrams significantly larger than the |
| 7008 | # negotiated MFL are sent. |
| 7009 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7010 | requires_config_enabled MBEDTLS_RSA_C |
| 7011 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7012 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7013 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7014 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7015 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7016 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7017 | crt_file=data_files/server7_int-ca.crt \ |
| 7018 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7019 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7020 | max_frag_len=2048" \ |
| 7021 | "$P_CLI dtls=1 debug_level=2 \ |
| 7022 | crt_file=data_files/server8_int-ca2.crt \ |
| 7023 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7024 | hs_timeout=2500-60000 \ |
| 7025 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7026 | 0 \ |
| 7027 | -s "found fragmented DTLS handshake message" \ |
| 7028 | -c "found fragmented DTLS handshake message" \ |
| 7029 | -C "error" |
| 7030 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7031 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7032 | requires_config_enabled MBEDTLS_RSA_C |
| 7033 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7034 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7035 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7036 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7037 | crt_file=data_files/server7_int-ca.crt \ |
| 7038 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7039 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7040 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7041 | "$P_CLI dtls=1 debug_level=2 \ |
| 7042 | crt_file=data_files/server8_int-ca2.crt \ |
| 7043 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7044 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7045 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7046 | 0 \ |
| 7047 | -S "found fragmented DTLS handshake message" \ |
| 7048 | -C "found fragmented DTLS handshake message" \ |
| 7049 | -C "error" |
| 7050 | |
| 7051 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7052 | requires_config_enabled MBEDTLS_RSA_C |
| 7053 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7054 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7055 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7056 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7057 | crt_file=data_files/server7_int-ca.crt \ |
| 7058 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7059 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7060 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7061 | "$P_CLI dtls=1 debug_level=2 \ |
| 7062 | crt_file=data_files/server8_int-ca2.crt \ |
| 7063 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7064 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7065 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7066 | 0 \ |
| 7067 | -s "found fragmented DTLS handshake message" \ |
| 7068 | -C "found fragmented DTLS handshake message" \ |
| 7069 | -C "error" |
| 7070 | |
| 7071 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7072 | requires_config_enabled MBEDTLS_RSA_C |
| 7073 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7074 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7075 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7076 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7077 | crt_file=data_files/server7_int-ca.crt \ |
| 7078 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7079 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7080 | mtu=512" \ |
| 7081 | "$P_CLI dtls=1 debug_level=2 \ |
| 7082 | crt_file=data_files/server8_int-ca2.crt \ |
| 7083 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7084 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7085 | mtu=2048" \ |
| 7086 | 0 \ |
| 7087 | -S "found fragmented DTLS handshake message" \ |
| 7088 | -c "found fragmented DTLS handshake message" \ |
| 7089 | -C "error" |
| 7090 | |
| 7091 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7092 | requires_config_enabled MBEDTLS_RSA_C |
| 7093 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7094 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7095 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7096 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7097 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7098 | crt_file=data_files/server7_int-ca.crt \ |
| 7099 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7100 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7101 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7102 | "$P_CLI dtls=1 debug_level=2 \ |
| 7103 | crt_file=data_files/server8_int-ca2.crt \ |
| 7104 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7105 | hs_timeout=2500-60000 \ |
| 7106 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7107 | 0 \ |
| 7108 | -s "found fragmented DTLS handshake message" \ |
| 7109 | -c "found fragmented DTLS handshake message" \ |
| 7110 | -C "error" |
| 7111 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7112 | # 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] | 7113 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7114 | requires_config_enabled MBEDTLS_RSA_C |
| 7115 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7116 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7117 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7118 | requires_config_enabled MBEDTLS_AES_C |
| 7119 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7120 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7121 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7122 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7123 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7124 | crt_file=data_files/server7_int-ca.crt \ |
| 7125 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7126 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7127 | mtu=512" \ |
| 7128 | "$P_CLI dtls=1 debug_level=2 \ |
| 7129 | crt_file=data_files/server8_int-ca2.crt \ |
| 7130 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7131 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7132 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7133 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7134 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7135 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7136 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7137 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7138 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7139 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7140 | # 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] | 7141 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7142 | # retransmissions, but in some cases (like both the server and client using |
| 7143 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7144 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7145 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7146 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7147 | requires_config_enabled MBEDTLS_RSA_C |
| 7148 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7149 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7150 | requires_config_enabled MBEDTLS_AES_C |
| 7151 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7152 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7153 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7154 | -p "$P_PXY mtu=508" \ |
| 7155 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7156 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7157 | key_file=data_files/server7.key \ |
| 7158 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7159 | "$P_CLI dtls=1 debug_level=2 \ |
| 7160 | crt_file=data_files/server8_int-ca2.crt \ |
| 7161 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7162 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7163 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7164 | 0 \ |
| 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 508 with full config. |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7170 | only_with_valgrind |
| 7171 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7172 | requires_config_enabled MBEDTLS_RSA_C |
| 7173 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7174 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7175 | requires_config_enabled MBEDTLS_AES_C |
| 7176 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7177 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7178 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7179 | -p "$P_PXY mtu=508" \ |
| 7180 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7181 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7182 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7183 | hs_timeout=250-10000" \ |
| 7184 | "$P_CLI dtls=1 debug_level=2 \ |
| 7185 | crt_file=data_files/server8_int-ca2.crt \ |
| 7186 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7187 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7188 | hs_timeout=250-10000" \ |
| 7189 | 0 \ |
| 7190 | -s "found fragmented DTLS handshake message" \ |
| 7191 | -c "found fragmented DTLS handshake message" \ |
| 7192 | -C "error" |
| 7193 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7194 | # 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] | 7195 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7196 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7197 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7198 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7199 | requires_config_enabled MBEDTLS_RSA_C |
| 7200 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7201 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7202 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7203 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7204 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7205 | crt_file=data_files/server7_int-ca.crt \ |
| 7206 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7207 | hs_timeout=10000-60000 \ |
| 7208 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7209 | "$P_CLI dtls=1 debug_level=2 \ |
| 7210 | crt_file=data_files/server8_int-ca2.crt \ |
| 7211 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7212 | hs_timeout=10000-60000 \ |
| 7213 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7214 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7215 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7216 | -s "found fragmented DTLS handshake message" \ |
| 7217 | -c "found fragmented DTLS handshake message" \ |
| 7218 | -C "error" |
| 7219 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7220 | # 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] | 7221 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7222 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7223 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7224 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 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 (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 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 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7237 | hs_timeout=10000-60000 \ |
| 7238 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7239 | "$P_CLI dtls=1 debug_level=2 \ |
| 7240 | crt_file=data_files/server8_int-ca2.crt \ |
| 7241 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7242 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7243 | hs_timeout=10000-60000 \ |
| 7244 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7245 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7246 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7247 | -s "found fragmented DTLS handshake message" \ |
| 7248 | -c "found fragmented DTLS handshake message" \ |
| 7249 | -C "error" |
| 7250 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7251 | not_with_valgrind # spurious autoreduction due to timeout |
| 7252 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7253 | requires_config_enabled MBEDTLS_RSA_C |
| 7254 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7255 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7256 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7257 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7258 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7259 | crt_file=data_files/server7_int-ca.crt \ |
| 7260 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7261 | hs_timeout=10000-60000 \ |
| 7262 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7263 | "$P_CLI dtls=1 debug_level=2 \ |
| 7264 | crt_file=data_files/server8_int-ca2.crt \ |
| 7265 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7266 | hs_timeout=10000-60000 \ |
| 7267 | mtu=1024 nbio=2" \ |
| 7268 | 0 \ |
| 7269 | -S "autoreduction" \ |
| 7270 | -s "found fragmented DTLS handshake message" \ |
| 7271 | -c "found fragmented DTLS handshake message" \ |
| 7272 | -C "error" |
| 7273 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7274 | # 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] | 7275 | not_with_valgrind # spurious autoreduction due to timeout |
| 7276 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7277 | requires_config_enabled MBEDTLS_RSA_C |
| 7278 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7279 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7280 | requires_config_enabled MBEDTLS_AES_C |
| 7281 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7282 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7283 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7284 | -p "$P_PXY mtu=512" \ |
| 7285 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7286 | crt_file=data_files/server7_int-ca.crt \ |
| 7287 | key_file=data_files/server7.key \ |
| 7288 | hs_timeout=10000-60000 \ |
| 7289 | mtu=512 nbio=2" \ |
| 7290 | "$P_CLI dtls=1 debug_level=2 \ |
| 7291 | crt_file=data_files/server8_int-ca2.crt \ |
| 7292 | key_file=data_files/server8.key \ |
| 7293 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7294 | hs_timeout=10000-60000 \ |
| 7295 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7296 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7297 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7298 | -s "found fragmented DTLS handshake message" \ |
| 7299 | -c "found fragmented DTLS handshake message" \ |
| 7300 | -C "error" |
| 7301 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7302 | # 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] | 7303 | # This ensures things still work after session_reset(). |
| 7304 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7305 | # Since we don't support reading fragmented ClientHello yet, |
| 7306 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7307 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7308 | # An autoreduction on the client-side might happen if the server is |
| 7309 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7310 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7311 | # resumed listening, which would result in a spurious autoreduction. |
| 7312 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7313 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7314 | requires_config_enabled MBEDTLS_RSA_C |
| 7315 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7316 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7317 | requires_config_enabled MBEDTLS_AES_C |
| 7318 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7319 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7320 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7321 | -p "$P_PXY mtu=1450" \ |
| 7322 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7323 | crt_file=data_files/server7_int-ca.crt \ |
| 7324 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7325 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7326 | mtu=1450" \ |
| 7327 | "$P_CLI dtls=1 debug_level=2 \ |
| 7328 | crt_file=data_files/server8_int-ca2.crt \ |
| 7329 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7330 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7331 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7332 | 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] | 7333 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7334 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7335 | -s "found fragmented DTLS handshake message" \ |
| 7336 | -c "found fragmented DTLS handshake message" \ |
| 7337 | -C "error" |
| 7338 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7339 | # An autoreduction on the client-side might happen if the server is |
| 7340 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7341 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7342 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7343 | requires_config_enabled MBEDTLS_RSA_C |
| 7344 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7345 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7346 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7347 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7348 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7349 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7350 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7351 | -p "$P_PXY mtu=512" \ |
| 7352 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7353 | crt_file=data_files/server7_int-ca.crt \ |
| 7354 | key_file=data_files/server7.key \ |
| 7355 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7356 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7357 | mtu=512" \ |
| 7358 | "$P_CLI dtls=1 debug_level=2 \ |
| 7359 | crt_file=data_files/server8_int-ca2.crt \ |
| 7360 | key_file=data_files/server8.key \ |
| 7361 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7362 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7363 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7364 | mtu=512" \ |
| 7365 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7366 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7367 | -s "found fragmented DTLS handshake message" \ |
| 7368 | -c "found fragmented DTLS handshake message" \ |
| 7369 | -C "error" |
| 7370 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7371 | # An autoreduction on the client-side might happen if the server is |
| 7372 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7373 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7374 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7375 | requires_config_enabled MBEDTLS_RSA_C |
| 7376 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7377 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7378 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7379 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7380 | requires_config_enabled MBEDTLS_AES_C |
| 7381 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7382 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7383 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7384 | -p "$P_PXY mtu=512" \ |
| 7385 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7386 | crt_file=data_files/server7_int-ca.crt \ |
| 7387 | key_file=data_files/server7.key \ |
| 7388 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7389 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7390 | mtu=512" \ |
| 7391 | "$P_CLI dtls=1 debug_level=2 \ |
| 7392 | crt_file=data_files/server8_int-ca2.crt \ |
| 7393 | key_file=data_files/server8.key \ |
| 7394 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7395 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7396 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7397 | mtu=512" \ |
| 7398 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7399 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7400 | -s "found fragmented DTLS handshake message" \ |
| 7401 | -c "found fragmented DTLS handshake message" \ |
| 7402 | -C "error" |
| 7403 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7404 | # An autoreduction on the client-side might happen if the server is |
| 7405 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7406 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7407 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7408 | requires_config_enabled MBEDTLS_RSA_C |
| 7409 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7410 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7411 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7412 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7413 | requires_config_enabled MBEDTLS_AES_C |
| 7414 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7415 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7416 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7417 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7418 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7419 | crt_file=data_files/server7_int-ca.crt \ |
| 7420 | key_file=data_files/server7.key \ |
| 7421 | exchanges=2 renegotiation=1 \ |
| 7422 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7423 | hs_timeout=10000-60000 \ |
| 7424 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7425 | "$P_CLI dtls=1 debug_level=2 \ |
| 7426 | crt_file=data_files/server8_int-ca2.crt \ |
| 7427 | key_file=data_files/server8.key \ |
| 7428 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7429 | hs_timeout=10000-60000 \ |
| 7430 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7431 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7432 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7433 | -s "found fragmented DTLS handshake message" \ |
| 7434 | -c "found fragmented DTLS handshake message" \ |
| 7435 | -C "error" |
| 7436 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7437 | # An autoreduction on the client-side might happen if the server is |
| 7438 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7439 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7440 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7441 | requires_config_enabled MBEDTLS_RSA_C |
| 7442 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7443 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7444 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7445 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7446 | requires_config_enabled MBEDTLS_AES_C |
| 7447 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7448 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7449 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7450 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7451 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7452 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7453 | crt_file=data_files/server7_int-ca.crt \ |
| 7454 | key_file=data_files/server7.key \ |
| 7455 | exchanges=2 renegotiation=1 \ |
| 7456 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7457 | hs_timeout=10000-60000 \ |
| 7458 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7459 | "$P_CLI dtls=1 debug_level=2 \ |
| 7460 | crt_file=data_files/server8_int-ca2.crt \ |
| 7461 | key_file=data_files/server8.key \ |
| 7462 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7463 | hs_timeout=10000-60000 \ |
| 7464 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7465 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7466 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7467 | -s "found fragmented DTLS handshake message" \ |
| 7468 | -c "found fragmented DTLS handshake message" \ |
| 7469 | -C "error" |
| 7470 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7471 | # An autoreduction on the client-side might happen if the server is |
| 7472 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7473 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7474 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7475 | requires_config_enabled MBEDTLS_RSA_C |
| 7476 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7477 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7478 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7479 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7480 | requires_config_enabled MBEDTLS_AES_C |
| 7481 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7482 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7483 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7484 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7485 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7486 | crt_file=data_files/server7_int-ca.crt \ |
| 7487 | key_file=data_files/server7.key \ |
| 7488 | exchanges=2 renegotiation=1 \ |
| 7489 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7490 | hs_timeout=10000-60000 \ |
| 7491 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7492 | "$P_CLI dtls=1 debug_level=2 \ |
| 7493 | crt_file=data_files/server8_int-ca2.crt \ |
| 7494 | key_file=data_files/server8.key \ |
| 7495 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7496 | hs_timeout=10000-60000 \ |
| 7497 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7498 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7499 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7500 | -s "found fragmented DTLS handshake message" \ |
| 7501 | -c "found fragmented DTLS handshake message" \ |
| 7502 | -C "error" |
| 7503 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7504 | # 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] | 7505 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7506 | requires_config_enabled MBEDTLS_RSA_C |
| 7507 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7508 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7509 | requires_config_enabled MBEDTLS_AES_C |
| 7510 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7511 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7512 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7513 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7514 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7515 | "$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] | 7516 | crt_file=data_files/server7_int-ca.crt \ |
| 7517 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7518 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7519 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7520 | crt_file=data_files/server8_int-ca2.crt \ |
| 7521 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7522 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7523 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7524 | 0 \ |
| 7525 | -s "found fragmented DTLS handshake message" \ |
| 7526 | -c "found fragmented DTLS handshake message" \ |
| 7527 | -C "error" |
| 7528 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7529 | # 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] | 7530 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7531 | requires_config_enabled MBEDTLS_RSA_C |
| 7532 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7533 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7534 | requires_config_enabled MBEDTLS_AES_C |
| 7535 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7536 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7537 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7538 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7539 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7540 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7541 | crt_file=data_files/server7_int-ca.crt \ |
| 7542 | key_file=data_files/server7.key \ |
| 7543 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7544 | "$P_CLI dtls=1 debug_level=2 \ |
| 7545 | crt_file=data_files/server8_int-ca2.crt \ |
| 7546 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7547 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7548 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7549 | 0 \ |
| 7550 | -s "found fragmented DTLS handshake message" \ |
| 7551 | -c "found fragmented DTLS handshake message" \ |
| 7552 | -C "error" |
| 7553 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7554 | # interop tests for DTLS fragmentating with reliable connection |
| 7555 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7556 | # here and below we just want to test that the we fragment in a way that |
| 7557 | # pleases other implementations, so we don't need the peer to fragment |
| 7558 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7559 | requires_config_enabled MBEDTLS_RSA_C |
| 7560 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7562 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7563 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7564 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7565 | "$G_SRV -u" \ |
| 7566 | "$P_CLI dtls=1 debug_level=2 \ |
| 7567 | crt_file=data_files/server8_int-ca2.crt \ |
| 7568 | key_file=data_files/server8.key \ |
| 7569 | mtu=512 force_version=dtls1_2" \ |
| 7570 | 0 \ |
| 7571 | -c "fragmenting handshake message" \ |
| 7572 | -C "error" |
| 7573 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7574 | # We use --insecure for the GnuTLS client because it expects |
| 7575 | # the hostname / IP it connects to to be the name used in the |
| 7576 | # certificate obtained from the server. Here, however, it |
| 7577 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7578 | # as the server name in the certificate. This will make the |
| 7579 | # certifiate validation fail, but passing --insecure makes |
| 7580 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7581 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7582 | requires_config_enabled MBEDTLS_RSA_C |
| 7583 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7585 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7586 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7587 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7588 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7589 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7590 | crt_file=data_files/server7_int-ca.crt \ |
| 7591 | key_file=data_files/server7.key \ |
| 7592 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7593 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7594 | 0 \ |
| 7595 | -s "fragmenting handshake message" |
| 7596 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7597 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7598 | requires_config_enabled MBEDTLS_RSA_C |
| 7599 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7601 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7602 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7603 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7604 | "$P_CLI dtls=1 debug_level=2 \ |
| 7605 | crt_file=data_files/server8_int-ca2.crt \ |
| 7606 | key_file=data_files/server8.key \ |
| 7607 | mtu=512 force_version=dtls1_2" \ |
| 7608 | 0 \ |
| 7609 | -c "fragmenting handshake message" \ |
| 7610 | -C "error" |
| 7611 | |
| 7612 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7613 | requires_config_enabled MBEDTLS_RSA_C |
| 7614 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7616 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7617 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7618 | "$P_SRV dtls=1 debug_level=2 \ |
| 7619 | crt_file=data_files/server7_int-ca.crt \ |
| 7620 | key_file=data_files/server7.key \ |
| 7621 | mtu=512 force_version=dtls1_2" \ |
| 7622 | "$O_CLI -dtls1_2" \ |
| 7623 | 0 \ |
| 7624 | -s "fragmenting handshake message" |
| 7625 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7626 | # interop tests for DTLS fragmentating with unreliable connection |
| 7627 | # |
| 7628 | # again we just want to test that the we fragment in a way that |
| 7629 | # pleases other implementations, so we don't need the peer to fragment |
| 7630 | requires_gnutls_next |
| 7631 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7632 | requires_config_enabled MBEDTLS_RSA_C |
| 7633 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7634 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7635 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7636 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7637 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7638 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7639 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7640 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7641 | crt_file=data_files/server8_int-ca2.crt \ |
| 7642 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7643 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7644 | 0 \ |
| 7645 | -c "fragmenting handshake message" \ |
| 7646 | -C "error" |
| 7647 | |
| 7648 | requires_gnutls_next |
| 7649 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7650 | requires_config_enabled MBEDTLS_RSA_C |
| 7651 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7652 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7653 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7654 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7655 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7656 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7657 | "$P_SRV dtls=1 debug_level=2 \ |
| 7658 | crt_file=data_files/server7_int-ca.crt \ |
| 7659 | key_file=data_files/server7.key \ |
| 7660 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7661 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7662 | 0 \ |
| 7663 | -s "fragmenting handshake message" |
| 7664 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7665 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7666 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7667 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7668 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7669 | ## (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] | 7670 | skip_next_test |
| 7671 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7672 | requires_config_enabled MBEDTLS_RSA_C |
| 7673 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7674 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7675 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7676 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7677 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7678 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7679 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7680 | "$P_CLI dtls=1 debug_level=2 \ |
| 7681 | crt_file=data_files/server8_int-ca2.crt \ |
| 7682 | key_file=data_files/server8.key \ |
| 7683 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7684 | 0 \ |
| 7685 | -c "fragmenting handshake message" \ |
| 7686 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7687 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7688 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7689 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7690 | requires_config_enabled MBEDTLS_RSA_C |
| 7691 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7692 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7693 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7694 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7695 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7696 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7697 | "$P_SRV dtls=1 debug_level=2 \ |
| 7698 | crt_file=data_files/server7_int-ca.crt \ |
| 7699 | key_file=data_files/server7.key \ |
| 7700 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7701 | "$O_CLI -dtls1_2" \ |
| 7702 | 0 \ |
| 7703 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7704 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7705 | # Tests for DTLS-SRTP (RFC 5764) |
| 7706 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7707 | run_test "DTLS-SRTP all profiles supported" \ |
| 7708 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7709 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7710 | 0 \ |
| 7711 | -s "found use_srtp extension" \ |
| 7712 | -s "found srtp profile" \ |
| 7713 | -s "selected srtp profile" \ |
| 7714 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7715 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7716 | -c "client hello, adding use_srtp extension" \ |
| 7717 | -c "found use_srtp extension" \ |
| 7718 | -c "found srtp profile" \ |
| 7719 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7720 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7721 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7722 | -C "error" |
| 7723 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7724 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7725 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7726 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7727 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7728 | "$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] | 7729 | 0 \ |
| 7730 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7731 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7732 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7733 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7734 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7735 | -c "client hello, adding use_srtp extension" \ |
| 7736 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7737 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7738 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7739 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7740 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7741 | -C "error" |
| 7742 | |
| 7743 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7744 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7745 | "$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] | 7746 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7747 | 0 \ |
| 7748 | -s "found use_srtp extension" \ |
| 7749 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7750 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 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" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7755 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7756 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7757 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7758 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7759 | -C "error" |
| 7760 | |
| 7761 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7762 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7763 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7764 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7765 | 0 \ |
| 7766 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7767 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7768 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7769 | -s "server hello, adding use_srtp extension" \ |
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" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7773 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7774 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7775 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7776 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7777 | -C "error" |
| 7778 | |
| 7779 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7780 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 7781 | "$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] | 7782 | "$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] | 7783 | 0 \ |
| 7784 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7785 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7786 | -S "selected srtp profile" \ |
| 7787 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7788 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7789 | -c "client hello, adding use_srtp extension" \ |
| 7790 | -C "found use_srtp extension" \ |
| 7791 | -C "found srtp profile" \ |
| 7792 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7793 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7794 | -C "error" |
| 7795 | |
| 7796 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7797 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7798 | "$P_SRV dtls=1 debug_level=3" \ |
| 7799 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7800 | 0 \ |
| 7801 | -s "found use_srtp extension" \ |
| 7802 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7803 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7804 | -c "client hello, adding use_srtp extension" \ |
| 7805 | -C "found use_srtp extension" \ |
| 7806 | -C "found srtp profile" \ |
| 7807 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7808 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7809 | -C "error" |
| 7810 | |
| 7811 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7812 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 7813 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 7814 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7815 | 0 \ |
| 7816 | -s "found use_srtp extension" \ |
| 7817 | -s "found srtp profile" \ |
| 7818 | -s "selected srtp profile" \ |
| 7819 | -s "server hello, adding use_srtp extension" \ |
| 7820 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7821 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7822 | -c "client hello, adding use_srtp extension" \ |
| 7823 | -c "found use_srtp extension" \ |
| 7824 | -c "found srtp profile" \ |
| 7825 | -c "selected srtp profile" \ |
| 7826 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7827 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7828 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7829 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7830 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7831 | -C "error" |
| 7832 | |
| 7833 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7834 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7835 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7836 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7837 | 0 \ |
| 7838 | -s "found use_srtp extension" \ |
| 7839 | -s "found srtp profile" \ |
| 7840 | -s "selected srtp profile" \ |
| 7841 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7842 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7843 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7844 | -S "dumping 'using mki' (8 bytes)" \ |
| 7845 | -c "client hello, adding use_srtp extension" \ |
| 7846 | -c "found use_srtp extension" \ |
| 7847 | -c "found srtp profile" \ |
| 7848 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7849 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7850 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7851 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7852 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7853 | -C "dumping 'received mki' (8 bytes)" \ |
| 7854 | -C "error" |
| 7855 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7856 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7857 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7858 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7859 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7860 | 0 \ |
| 7861 | -s "found use_srtp extension" \ |
| 7862 | -s "found srtp profile" \ |
| 7863 | -s "selected srtp profile" \ |
| 7864 | -s "server hello, adding use_srtp extension" \ |
| 7865 | -s "DTLS-SRTP key material is"\ |
| 7866 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7867 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7868 | |
| 7869 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7870 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7871 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7872 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7873 | 0 \ |
| 7874 | -s "found use_srtp extension" \ |
| 7875 | -s "found srtp profile" \ |
| 7876 | -s "selected srtp profile" \ |
| 7877 | -s "server hello, adding use_srtp extension" \ |
| 7878 | -s "DTLS-SRTP key material is"\ |
| 7879 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7880 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7881 | |
| 7882 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7883 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7884 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7885 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7886 | 0 \ |
| 7887 | -s "found use_srtp extension" \ |
| 7888 | -s "found srtp profile" \ |
| 7889 | -s "selected srtp profile" \ |
| 7890 | -s "server hello, adding use_srtp extension" \ |
| 7891 | -s "DTLS-SRTP key material is"\ |
| 7892 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7893 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7894 | |
| 7895 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7896 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7897 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7898 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7899 | 0 \ |
| 7900 | -s "found use_srtp extension" \ |
| 7901 | -s "found srtp profile" \ |
| 7902 | -s "selected srtp profile" \ |
| 7903 | -s "server hello, adding use_srtp extension" \ |
| 7904 | -s "DTLS-SRTP key material is"\ |
| 7905 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7906 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7907 | |
| 7908 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7909 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7910 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7911 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7912 | 0 \ |
| 7913 | -s "found use_srtp extension" \ |
| 7914 | -s "found srtp profile" \ |
| 7915 | -s "selected srtp profile" \ |
| 7916 | -s "server hello, adding use_srtp extension" \ |
| 7917 | -s "DTLS-SRTP key material is"\ |
| 7918 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7919 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7920 | |
| 7921 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7922 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7923 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7924 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7925 | 0 \ |
| 7926 | -s "found use_srtp extension" \ |
| 7927 | -s "found srtp profile" \ |
| 7928 | -S "selected srtp profile" \ |
| 7929 | -S "server hello, adding use_srtp extension" \ |
| 7930 | -S "DTLS-SRTP key material is"\ |
| 7931 | -C "SRTP Extension negotiated, profile" |
| 7932 | |
| 7933 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7934 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7935 | "$P_SRV dtls=1 debug_level=3" \ |
| 7936 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7937 | 0 \ |
| 7938 | -s "found use_srtp extension" \ |
| 7939 | -S "server hello, adding use_srtp extension" \ |
| 7940 | -S "DTLS-SRTP key material is"\ |
| 7941 | -C "SRTP Extension negotiated, profile" |
| 7942 | |
| 7943 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7944 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7945 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7946 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7947 | 0 \ |
| 7948 | -c "client hello, adding use_srtp extension" \ |
| 7949 | -c "found use_srtp extension" \ |
| 7950 | -c "found srtp profile" \ |
| 7951 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7952 | -c "DTLS-SRTP key material is"\ |
| 7953 | -C "error" |
| 7954 | |
| 7955 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7956 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7957 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7958 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7959 | 0 \ |
| 7960 | -c "client hello, adding use_srtp extension" \ |
| 7961 | -c "found use_srtp extension" \ |
| 7962 | -c "found srtp profile" \ |
| 7963 | -c "selected srtp profile" \ |
| 7964 | -c "DTLS-SRTP key material is"\ |
| 7965 | -C "error" |
| 7966 | |
| 7967 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7968 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7969 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7970 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7971 | 0 \ |
| 7972 | -c "client hello, adding use_srtp extension" \ |
| 7973 | -c "found use_srtp extension" \ |
| 7974 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7975 | -c "selected srtp profile" \ |
| 7976 | -c "DTLS-SRTP key material is"\ |
| 7977 | -C "error" |
| 7978 | |
| 7979 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7980 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7981 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7982 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7983 | 0 \ |
| 7984 | -c "client hello, adding use_srtp extension" \ |
| 7985 | -c "found use_srtp extension" \ |
| 7986 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7987 | -c "selected srtp profile" \ |
| 7988 | -c "DTLS-SRTP key material is"\ |
| 7989 | -C "error" |
| 7990 | |
| 7991 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7992 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7993 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7994 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7995 | 0 \ |
| 7996 | -c "client hello, adding use_srtp extension" \ |
| 7997 | -c "found use_srtp extension" \ |
| 7998 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7999 | -c "selected srtp profile" \ |
| 8000 | -c "DTLS-SRTP key material is"\ |
| 8001 | -C "error" |
| 8002 | |
| 8003 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8004 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 8005 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8006 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 8007 | 0 \ |
| 8008 | -c "client hello, adding use_srtp extension" \ |
| 8009 | -C "found use_srtp extension" \ |
| 8010 | -C "found srtp profile" \ |
| 8011 | -C "selected srtp profile" \ |
| 8012 | -C "DTLS-SRTP key material is"\ |
| 8013 | -C "error" |
| 8014 | |
| 8015 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8016 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 8017 | "$O_SRV -dtls" \ |
| 8018 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8019 | 0 \ |
| 8020 | -c "client hello, adding use_srtp extension" \ |
| 8021 | -C "found use_srtp extension" \ |
| 8022 | -C "found srtp profile" \ |
| 8023 | -C "selected srtp profile" \ |
| 8024 | -C "DTLS-SRTP key material is"\ |
| 8025 | -C "error" |
| 8026 | |
| 8027 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8028 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 8029 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8030 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8031 | 0 \ |
| 8032 | -c "client hello, adding use_srtp extension" \ |
| 8033 | -c "found use_srtp extension" \ |
| 8034 | -c "found srtp profile" \ |
| 8035 | -c "selected srtp profile" \ |
| 8036 | -c "DTLS-SRTP key material is"\ |
| 8037 | -c "DTLS-SRTP no mki value negotiated"\ |
| 8038 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8039 | -C "dumping 'received mki' (8 bytes)" \ |
| 8040 | -C "error" |
| 8041 | |
| 8042 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8043 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8044 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8045 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8046 | "$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] | 8047 | 0 \ |
| 8048 | -s "found use_srtp extension" \ |
| 8049 | -s "found srtp profile" \ |
| 8050 | -s "selected srtp profile" \ |
| 8051 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8052 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8053 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8054 | |
| 8055 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8056 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8057 | 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] | 8058 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8059 | "$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] | 8060 | 0 \ |
| 8061 | -s "found use_srtp extension" \ |
| 8062 | -s "found srtp profile" \ |
| 8063 | -s "selected srtp profile" \ |
| 8064 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8065 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8066 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8067 | |
| 8068 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8069 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8070 | 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] | 8071 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8072 | "$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] | 8073 | 0 \ |
| 8074 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8075 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8076 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8077 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8078 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8079 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8080 | |
| 8081 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8082 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8083 | 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] | 8084 | "$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] | 8085 | "$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] | 8086 | 0 \ |
| 8087 | -s "found use_srtp extension" \ |
| 8088 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8089 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8090 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8091 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8092 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8093 | |
| 8094 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8095 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8096 | 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] | 8097 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8098 | "$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] | 8099 | 0 \ |
| 8100 | -s "found use_srtp extension" \ |
| 8101 | -s "found srtp profile" \ |
| 8102 | -s "selected srtp profile" \ |
| 8103 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8104 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8105 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8106 | |
| 8107 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8108 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8109 | 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] | 8110 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8111 | "$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] | 8112 | 0 \ |
| 8113 | -s "found use_srtp extension" \ |
| 8114 | -s "found srtp profile" \ |
| 8115 | -S "selected srtp profile" \ |
| 8116 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8117 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8118 | -C "SRTP profile:" |
| 8119 | |
| 8120 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8121 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8122 | 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] | 8123 | "$P_SRV dtls=1 debug_level=3" \ |
| 8124 | "$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] | 8125 | 0 \ |
| 8126 | -s "found use_srtp extension" \ |
| 8127 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8128 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8129 | -C "SRTP profile:" |
| 8130 | |
| 8131 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8132 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8133 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8134 | "$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" \ |
| 8135 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8136 | 0 \ |
| 8137 | -c "client hello, adding use_srtp extension" \ |
| 8138 | -c "found use_srtp extension" \ |
| 8139 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8140 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8141 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8142 | -C "error" |
| 8143 | |
| 8144 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8145 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8146 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8147 | "$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" \ |
| 8148 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8149 | 0 \ |
| 8150 | -c "client hello, adding use_srtp extension" \ |
| 8151 | -c "found use_srtp extension" \ |
| 8152 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8153 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8154 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8155 | -C "error" |
| 8156 | |
| 8157 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8158 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8159 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8160 | "$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" \ |
| 8161 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8162 | 0 \ |
| 8163 | -c "client hello, adding use_srtp extension" \ |
| 8164 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8165 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8166 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8167 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8168 | -C "error" |
| 8169 | |
| 8170 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8171 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8172 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8173 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8174 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8175 | 0 \ |
| 8176 | -c "client hello, adding use_srtp extension" \ |
| 8177 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8178 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8179 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8180 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8181 | -C "error" |
| 8182 | |
| 8183 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8184 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8185 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8186 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8187 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8188 | 0 \ |
| 8189 | -c "client hello, adding use_srtp extension" \ |
| 8190 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8191 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8192 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8193 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8194 | -C "error" |
| 8195 | |
| 8196 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8197 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8198 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8199 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8200 | "$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] | 8201 | 0 \ |
| 8202 | -c "client hello, adding use_srtp extension" \ |
| 8203 | -C "found use_srtp extension" \ |
| 8204 | -C "found srtp profile" \ |
| 8205 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8206 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8207 | -C "error" |
| 8208 | |
| 8209 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8210 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8211 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8212 | "$G_SRV -u" \ |
| 8213 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8214 | 0 \ |
| 8215 | -c "client hello, adding use_srtp extension" \ |
| 8216 | -C "found use_srtp extension" \ |
| 8217 | -C "found srtp profile" \ |
| 8218 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8219 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8220 | -C "error" |
| 8221 | |
| 8222 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8223 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8224 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8225 | "$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" \ |
| 8226 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8227 | 0 \ |
| 8228 | -c "client hello, adding use_srtp extension" \ |
| 8229 | -c "found use_srtp extension" \ |
| 8230 | -c "found srtp profile" \ |
| 8231 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8232 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8233 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8234 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8235 | -c "dumping 'received mki' (8 bytes)" \ |
| 8236 | -C "error" |
| 8237 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8238 | # Tests for specific things with "unreliable" UDP connection |
| 8239 | |
| 8240 | not_with_valgrind # spurious resend due to timeout |
| 8241 | run_test "DTLS proxy: reference" \ |
| 8242 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8243 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8244 | "$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] | 8245 | 0 \ |
| 8246 | -C "replayed record" \ |
| 8247 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8248 | -C "Buffer record from epoch" \ |
| 8249 | -S "Buffer record from epoch" \ |
| 8250 | -C "ssl_buffer_message" \ |
| 8251 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8252 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8253 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8254 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8255 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8256 | -c "HTTP/1.0 200 OK" |
| 8257 | |
| 8258 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8259 | run_test "DTLS proxy: duplicate every packet" \ |
| 8260 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8261 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8262 | "$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] | 8263 | 0 \ |
| 8264 | -c "replayed record" \ |
| 8265 | -s "replayed record" \ |
| 8266 | -c "record from another epoch" \ |
| 8267 | -s "record from another epoch" \ |
| 8268 | -S "resend" \ |
| 8269 | -s "Extra-header:" \ |
| 8270 | -c "HTTP/1.0 200 OK" |
| 8271 | |
| 8272 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8273 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8274 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8275 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8276 | 0 \ |
| 8277 | -c "replayed record" \ |
| 8278 | -S "replayed record" \ |
| 8279 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8280 | -s "record from another epoch" \ |
| 8281 | -c "resend" \ |
| 8282 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8283 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8284 | -c "HTTP/1.0 200 OK" |
| 8285 | |
| 8286 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8287 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8288 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8289 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8290 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8291 | -c "next record in same datagram" \ |
| 8292 | -s "next record in same datagram" |
| 8293 | |
| 8294 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8295 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8296 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8297 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8298 | 0 \ |
| 8299 | -c "next record in same datagram" \ |
| 8300 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8301 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8302 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8303 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8304 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8305 | "$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] | 8306 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8307 | -c "discarding invalid record (mac)" \ |
| 8308 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8309 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8310 | -c "HTTP/1.0 200 OK" \ |
| 8311 | -S "too many records with bad MAC" \ |
| 8312 | -S "Verification of the message MAC failed" |
| 8313 | |
| 8314 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8315 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8316 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8317 | "$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] | 8318 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8319 | -C "discarding invalid record (mac)" \ |
| 8320 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8321 | -S "Extra-header:" \ |
| 8322 | -C "HTTP/1.0 200 OK" \ |
| 8323 | -s "too many records with bad MAC" \ |
| 8324 | -s "Verification of the message MAC failed" |
| 8325 | |
| 8326 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8327 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8328 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8329 | "$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] | 8330 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8331 | -c "discarding invalid record (mac)" \ |
| 8332 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8333 | -s "Extra-header:" \ |
| 8334 | -c "HTTP/1.0 200 OK" \ |
| 8335 | -S "too many records with bad MAC" \ |
| 8336 | -S "Verification of the message MAC failed" |
| 8337 | |
| 8338 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8339 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8340 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8341 | "$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] | 8342 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8343 | -c "discarding invalid record (mac)" \ |
| 8344 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8345 | -s "Extra-header:" \ |
| 8346 | -c "HTTP/1.0 200 OK" \ |
| 8347 | -s "too many records with bad MAC" \ |
| 8348 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8349 | |
| 8350 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8351 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8352 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8353 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8354 | 0 \ |
| 8355 | -c "record from another epoch" \ |
| 8356 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8357 | -s "Extra-header:" \ |
| 8358 | -c "HTTP/1.0 200 OK" |
| 8359 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8360 | # Tests for reordering support with DTLS |
| 8361 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8362 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8363 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8364 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8365 | hs_timeout=2500-60000" \ |
| 8366 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8367 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8368 | 0 \ |
| 8369 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8370 | -c "Next handshake message has been buffered - load"\ |
| 8371 | -S "Buffering HS message" \ |
| 8372 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8373 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8374 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8375 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8376 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8377 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8378 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8379 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8380 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8381 | hs_timeout=2500-60000" \ |
| 8382 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8383 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8384 | 0 \ |
| 8385 | -c "Buffering HS message" \ |
| 8386 | -c "found fragmented DTLS handshake message"\ |
| 8387 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8388 | -c "Next handshake message has been buffered - load"\ |
| 8389 | -S "Buffering HS message" \ |
| 8390 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8391 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8392 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8393 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8394 | -S "Remember CCS message" |
| 8395 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8396 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8397 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8398 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8399 | # while keeping the ServerKeyExchange. |
| 8400 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8401 | 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] | 8402 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8403 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8404 | hs_timeout=2500-60000" \ |
| 8405 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8406 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8407 | 0 \ |
| 8408 | -c "Buffering HS message" \ |
| 8409 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8410 | -C "attempt to make space by freeing buffered messages" \ |
| 8411 | -S "Buffering HS message" \ |
| 8412 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8413 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8414 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8415 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8416 | -S "Remember CCS message" |
| 8417 | |
| 8418 | # The size constraints ensure that the delayed certificate message can't |
| 8419 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8420 | # when dropping it first. |
| 8421 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8422 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8423 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8424 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8425 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8426 | hs_timeout=2500-60000" \ |
| 8427 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8428 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8429 | 0 \ |
| 8430 | -c "Buffering HS message" \ |
| 8431 | -c "attempt to make space by freeing buffered future messages" \ |
| 8432 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8433 | -S "Buffering HS message" \ |
| 8434 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8435 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8436 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8437 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8438 | -S "Remember CCS message" |
| 8439 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8440 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8441 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8442 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8443 | hs_timeout=2500-60000" \ |
| 8444 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8445 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8446 | 0 \ |
| 8447 | -C "Buffering HS message" \ |
| 8448 | -C "Next handshake message has been buffered - load"\ |
| 8449 | -s "Buffering HS message" \ |
| 8450 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8451 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8452 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8453 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8454 | -S "Remember CCS message" |
| 8455 | |
| 8456 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8457 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8458 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8459 | hs_timeout=2500-60000" \ |
| 8460 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8461 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8462 | 0 \ |
| 8463 | -C "Buffering HS message" \ |
| 8464 | -C "Next handshake message has been buffered - load"\ |
| 8465 | -S "Buffering HS message" \ |
| 8466 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8467 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8468 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8469 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8470 | -S "Remember CCS message" |
| 8471 | |
| 8472 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8473 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8474 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8475 | hs_timeout=2500-60000" \ |
| 8476 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8477 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8478 | 0 \ |
| 8479 | -C "Buffering HS message" \ |
| 8480 | -C "Next handshake message has been buffered - load"\ |
| 8481 | -S "Buffering HS message" \ |
| 8482 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8483 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8484 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8485 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8486 | -s "Remember CCS message" |
| 8487 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8488 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8489 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8490 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8491 | hs_timeout=2500-60000" \ |
| 8492 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8493 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8494 | 0 \ |
| 8495 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8496 | -s "Found buffered record from current epoch - load" \ |
| 8497 | -c "Buffer record from epoch 1" \ |
| 8498 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8499 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8500 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8501 | # from the server are delayed, so that the encrypted Finished message |
| 8502 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8503 | # in afterwards, the encrypted Finished message must be freed in order |
| 8504 | # to make space for the NewSessionTicket to be reassembled. |
| 8505 | # This works only in very particular circumstances: |
| 8506 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8507 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8508 | # the encrypted Finished message. |
| 8509 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8510 | # needs to be fragmented. |
| 8511 | # - All messages sent by the server must be small enough to be either sent |
| 8512 | # without fragmentation or be reassembled within the bounds of |
| 8513 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8514 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8515 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8516 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8517 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8518 | -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] | 8519 | "$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] | 8520 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8521 | 0 \ |
| 8522 | -s "Buffer record from epoch 1" \ |
| 8523 | -s "Found buffered record from current epoch - load" \ |
| 8524 | -c "Buffer record from epoch 1" \ |
| 8525 | -C "Found buffered record from current epoch - load" \ |
| 8526 | -c "Enough space available after freeing future epoch record" |
| 8527 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8528 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8529 | |
| 8530 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8531 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8532 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8533 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8534 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8535 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8536 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8537 | 0 \ |
| 8538 | -s "Extra-header:" \ |
| 8539 | -c "HTTP/1.0 200 OK" |
| 8540 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8541 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8542 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8543 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8544 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8545 | "$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] | 8546 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8547 | 0 \ |
| 8548 | -s "Extra-header:" \ |
| 8549 | -c "HTTP/1.0 200 OK" |
| 8550 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8551 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8552 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8553 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8554 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8555 | "$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] | 8556 | 0 \ |
| 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 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8561 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 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=required" \ |
| 8564 | "$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] | 8565 | 0 \ |
| 8566 | -s "Extra-header:" \ |
| 8567 | -c "HTTP/1.0 200 OK" |
| 8568 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8569 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8570 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8571 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8572 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8573 | "$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] | 8574 | 0 \ |
| 8575 | -s "Extra-header:" \ |
| 8576 | -c "HTTP/1.0 200 OK" |
| 8577 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8578 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8579 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8580 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8581 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8582 | "$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] | 8583 | 0 \ |
| 8584 | -s "Extra-header:" \ |
| 8585 | -c "HTTP/1.0 200 OK" |
| 8586 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8587 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8588 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8589 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8590 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 8591 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8592 | "$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] | 8593 | 0 \ |
| 8594 | -s "Extra-header:" \ |
| 8595 | -c "HTTP/1.0 200 OK" |
| 8596 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8597 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8598 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8599 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8600 | "$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] | 8601 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8602 | "$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] | 8603 | 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] | 8604 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8605 | 0 \ |
| 8606 | -s "a session has been resumed" \ |
| 8607 | -c "a session has been resumed" \ |
| 8608 | -s "Extra-header:" \ |
| 8609 | -c "HTTP/1.0 200 OK" |
| 8610 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8611 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8612 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8613 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8614 | "$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] | 8615 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8616 | "$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] | 8617 | 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] | 8618 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8619 | 0 \ |
| 8620 | -s "a session has been resumed" \ |
| 8621 | -c "a session has been resumed" \ |
| 8622 | -s "Extra-header:" \ |
| 8623 | -c "HTTP/1.0 200 OK" |
| 8624 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8625 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8626 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8627 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8628 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8629 | "$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] | 8630 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8631 | "$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] | 8632 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8633 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8634 | 0 \ |
| 8635 | -c "=> renegotiate" \ |
| 8636 | -s "=> renegotiate" \ |
| 8637 | -s "Extra-header:" \ |
| 8638 | -c "HTTP/1.0 200 OK" |
| 8639 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8640 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8641 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8642 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8643 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8644 | "$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] | 8645 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8646 | "$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] | 8647 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8648 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8649 | 0 \ |
| 8650 | -c "=> renegotiate" \ |
| 8651 | -s "=> renegotiate" \ |
| 8652 | -s "Extra-header:" \ |
| 8653 | -c "HTTP/1.0 200 OK" |
| 8654 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8655 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8656 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8657 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8658 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8659 | "$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] | 8660 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8661 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8662 | "$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] | 8663 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8664 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8665 | 0 \ |
| 8666 | -c "=> renegotiate" \ |
| 8667 | -s "=> renegotiate" \ |
| 8668 | -s "Extra-header:" \ |
| 8669 | -c "HTTP/1.0 200 OK" |
| 8670 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8671 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8672 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8673 | 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] | 8674 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8675 | "$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] | 8676 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8677 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8678 | "$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] | 8679 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8680 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8681 | 0 \ |
| 8682 | -c "=> renegotiate" \ |
| 8683 | -s "=> renegotiate" \ |
| 8684 | -s "Extra-header:" \ |
| 8685 | -c "HTTP/1.0 200 OK" |
| 8686 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8687 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8688 | ## all versions installed on the CI machines), reported here: |
| 8689 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8690 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8691 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8692 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8693 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8694 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8695 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8696 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8697 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8698 | "$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] | 8699 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8700 | -c "HTTP/1.0 200 OK" |
| 8701 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8702 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8703 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8704 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8705 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8706 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8707 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8708 | "$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] | 8709 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8710 | -c "HTTP/1.0 200 OK" |
| 8711 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8712 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8713 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8714 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8715 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8716 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8717 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8718 | "$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] | 8719 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8720 | -c "HTTP/1.0 200 OK" |
| 8721 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8722 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8723 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8724 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8725 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8726 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8727 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8728 | "$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] | 8729 | 0 \ |
| 8730 | -s "Extra-header:" \ |
| 8731 | -c "Extra-header:" |
| 8732 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8733 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8734 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8735 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8736 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8737 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8738 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8739 | "$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] | 8740 | 0 \ |
| 8741 | -s "Extra-header:" \ |
| 8742 | -c "Extra-header:" |
| 8743 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8744 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8745 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8746 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8747 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8748 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8749 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8750 | "$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] | 8751 | 0 \ |
| 8752 | -s "Extra-header:" \ |
| 8753 | -c "Extra-header:" |
| 8754 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8755 | run_test "export keys functionality" \ |
| 8756 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8757 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8758 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8759 | -c "EAP-TLS key material is:"\ |
| 8760 | -s "EAP-TLS key material is:"\ |
| 8761 | -c "EAP-TLS IV is:" \ |
| 8762 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8763 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8764 | # openssl feature tests: check if tls1.3 exists. |
| 8765 | requires_openssl_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 8766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8767 | run_test "TLS1.3: Test openssl tls1_3 feature" \ |
| 8768 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 8769 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 8770 | 0 \ |
| 8771 | -c "TLS 1.3" \ |
| 8772 | -s "TLS 1.3" |
| 8773 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 8774 | # 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] | 8775 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8776 | requires_gnutls_next_no_ticket |
| 8777 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 8778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8779 | run_test "TLS1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 8780 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert " \ |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8781 | "$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] | 8782 | 0 \ |
| 8783 | -s "Version: TLS1.3" \ |
| 8784 | -c "Version: TLS1.3" |
| 8785 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8786 | # TLS1.3 test cases |
| 8787 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 8788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8790 | skip_handshake_stage_check |
| 8791 | run_test "TLS1.3: Not supported version check: tls1_2 and tls1_3" \ |
| 8792 | "$P_SRV debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8793 | "$P_CLI debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8794 | 1 \ |
| 8795 | -s "SSL - The requested feature is not available" \ |
| 8796 | -c "SSL - The requested feature is not available" \ |
| 8797 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 8798 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 8799 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8802 | run_test "TLS1.3: handshake dispatch test: tls1_3 only" \ |
Jerry Yu | 3523a3b | 2021-09-14 16:29:49 +0800 | [diff] [blame] | 8803 | "$P_SRV debug_level=2 min_version=tls1_3 max_version=tls1_3" \ |
| 8804 | "$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] | 8805 | 1 \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8806 | -s "tls1_3 server state: 0" \ |
| 8807 | -c "tls1_3 client state: 0" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8808 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8809 | requires_openssl_tls1_3 |
| 8810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 42920ec | 2021-09-28 14:31:15 +0800 | [diff] [blame] | 8811 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 8812 | run_test "TLS1.3: minimal feature sets - openssl" \ |
| 8813 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 8814 | "$P_CLI debug_level=3 min_version=tls1_3 max_version=tls1_3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 8815 | 0 \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8816 | -c "tls1_3 client state: 0" \ |
| 8817 | -c "tls1_3 client state: 2" \ |
| 8818 | -c "tls1_3 client state: 19" \ |
| 8819 | -c "tls1_3 client state: 5" \ |
| 8820 | -c "tls1_3 client state: 3" \ |
XiaokangQian | 3306284 | 2021-11-11 03:37:45 +0000 | [diff] [blame] | 8821 | -c "tls1_3 client state: 9" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8822 | -c "tls1_3 client state: 13" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8823 | -c "tls1_3 client state: 11" \ |
| 8824 | -c "tls1_3 client state: 14" \ |
Jerry Yu | 4ae2d62 | 2021-09-15 15:34:56 +0800 | [diff] [blame] | 8825 | -c "tls1_3 client state: 15" \ |
| 8826 | -c "<= ssl_tls1_3_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 8827 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 8828 | -c "ECDH curve: x25519" \ |
XiaokangQian | ab7f50d | 2021-10-21 06:23:29 +0000 | [diff] [blame] | 8829 | -c "=> ssl_tls1_3_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 8830 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 8831 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 8832 | -c "=> parse certificate verify" \ |
| 8833 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 8834 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 8835 | -c "<= parse finished message" \ |
| 8836 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8837 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8838 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 8839 | requires_gnutls_next_no_ticket |
| 8840 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 42920ec | 2021-09-28 14:31:15 +0800 | [diff] [blame] | 8842 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 8843 | run_test "TLS1.3: minimal feature sets - gnutls" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 8844 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 8845 | "$P_CLI debug_level=3 min_version=tls1_3 max_version=tls1_3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 8846 | 0 \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8847 | -s "SERVER HELLO was queued" \ |
| 8848 | -c "tls1_3 client state: 0" \ |
| 8849 | -c "tls1_3 client state: 2" \ |
| 8850 | -c "tls1_3 client state: 19" \ |
| 8851 | -c "tls1_3 client state: 5" \ |
| 8852 | -c "tls1_3 client state: 3" \ |
XiaokangQian | 3306284 | 2021-11-11 03:37:45 +0000 | [diff] [blame] | 8853 | -c "tls1_3 client state: 9" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8854 | -c "tls1_3 client state: 13" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8855 | -c "tls1_3 client state: 11" \ |
| 8856 | -c "tls1_3 client state: 14" \ |
Jerry Yu | 4ae2d62 | 2021-09-15 15:34:56 +0800 | [diff] [blame] | 8857 | -c "tls1_3 client state: 15" \ |
| 8858 | -c "<= ssl_tls1_3_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 8859 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 8860 | -c "ECDH curve: x25519" \ |
XiaokangQian | ab7f50d | 2021-10-21 06:23:29 +0000 | [diff] [blame] | 8861 | -c "=> ssl_tls1_3_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 8862 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 8863 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 8864 | -c "=> parse certificate verify" \ |
| 8865 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 8866 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 8867 | -c "<= parse finished message" \ |
| 8868 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 8869 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8870 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8871 | # Test heap memory usage after handshake |
| 8872 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8873 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8874 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8875 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8876 | run_tests_memory_after_hanshake |
| 8877 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8878 | # Final report |
| 8879 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8880 | echo "------------------------------------------------------------------------" |
| 8881 | |
| 8882 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8883 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8884 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8885 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8886 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8887 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8888 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8889 | |
| 8890 | exit $FAILS |