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 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 80 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 81 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 82 | else |
| 83 | G_NEXT_SRV=false |
| 84 | fi |
| 85 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 86 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 87 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 88 | else |
| 89 | G_NEXT_CLI=false |
| 90 | fi |
| 91 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 92 | TESTS=0 |
| 93 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 94 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 95 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 96 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 97 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 98 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 99 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 100 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 101 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 102 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 103 | RUN_TEST_NUMBER='' |
| 104 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 105 | PRESERVE_LOGS=0 |
| 106 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 107 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 108 | # port which is this plus 10000. Each port number may be independently |
| 109 | # overridden by a command line option. |
| 110 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 111 | PXY_PORT=$((SRV_PORT + 10000)) |
| 112 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 113 | print_usage() { |
| 114 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 115 | printf " -h|--help\tPrint this help.\n" |
| 116 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 117 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 118 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 119 | 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] | 120 | 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] | 121 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 122 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 123 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 124 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 125 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 126 | 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] | 127 | } |
| 128 | |
| 129 | get_options() { |
| 130 | while [ $# -gt 0 ]; do |
| 131 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 132 | -f|--filter) |
| 133 | shift; FILTER=$1 |
| 134 | ;; |
| 135 | -e|--exclude) |
| 136 | shift; EXCLUDE=$1 |
| 137 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 138 | -m|--memcheck) |
| 139 | MEMCHECK=1 |
| 140 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 141 | -n|--number) |
| 142 | shift; RUN_TEST_NUMBER=$1 |
| 143 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 144 | -s|--show-numbers) |
| 145 | SHOW_TEST_NUMBER=1 |
| 146 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 147 | -p|--preserve-logs) |
| 148 | PRESERVE_LOGS=1 |
| 149 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 150 | --port) |
| 151 | shift; SRV_PORT=$1 |
| 152 | ;; |
| 153 | --proxy-port) |
| 154 | shift; PXY_PORT=$1 |
| 155 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 156 | --seed) |
| 157 | shift; SEED="$1" |
| 158 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 159 | -h|--help) |
| 160 | print_usage |
| 161 | exit 0 |
| 162 | ;; |
| 163 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 164 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 165 | print_usage |
| 166 | exit 1 |
| 167 | ;; |
| 168 | esac |
| 169 | shift |
| 170 | done |
| 171 | } |
| 172 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 173 | # Make the outcome file path relative to the original directory, not |
| 174 | # to .../tests |
| 175 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 176 | [!/]*) |
| 177 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 178 | ;; |
| 179 | esac |
| 180 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 181 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 182 | # testing. Skip non-boolean options (with something other than spaces |
| 183 | # and a comment after "#define SYMBOL"). The variable contains a |
| 184 | # space-separated list of symbols. |
| 185 | CONFIGS_ENABLED=" $(<"$CONFIG_H" \ |
| 186 | sed -n 's!^ *#define *\([A-Za-z][0-9A-Z_a-z]*\) *\(/*\)*!\1!p' | |
| 187 | tr '\n' ' ')" |
| 188 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 189 | # Skip next test; use this macro to skip tests which are legitimate |
| 190 | # in theory and expected to be re-introduced at some point, but |
| 191 | # aren't expected to succeed at the moment due to problems outside |
| 192 | # our control (such as bugs in other TLS implementations). |
| 193 | skip_next_test() { |
| 194 | SKIP_NEXT="YES" |
| 195 | } |
| 196 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 197 | # 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] | 198 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 199 | case $CONFIGS_ENABLED in |
| 200 | *" $1 "*) :;; |
| 201 | *) SKIP_NEXT="YES";; |
| 202 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 203 | } |
| 204 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 205 | # 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] | 206 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 207 | case $CONFIGS_ENABLED in |
| 208 | *" $1 "*) SKIP_NEXT="YES";; |
| 209 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 210 | } |
| 211 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 212 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 213 | # This function uses the query_config command line option to query the |
| 214 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 215 | # program. The command will always return a success value if the |
| 216 | # configuration is defined and the value will be printed to stdout. |
| 217 | # |
| 218 | # Note that if the configuration is not defined or is defined to nothing, |
| 219 | # the output of this function will be an empty string. |
| 220 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 224 | VAL="$( get_config_value_or_default "$1" )" |
| 225 | if [ -z "$VAL" ]; then |
| 226 | # Should never happen |
| 227 | echo "Mbed TLS configuration $1 is not defined" |
| 228 | exit 1 |
| 229 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 230 | SKIP_NEXT="YES" |
| 231 | fi |
| 232 | } |
| 233 | |
| 234 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 235 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 236 | if [ -z "$VAL" ]; then |
| 237 | # Should never happen |
| 238 | echo "Mbed TLS configuration $1 is not defined" |
| 239 | exit 1 |
| 240 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 241 | SKIP_NEXT="YES" |
| 242 | fi |
| 243 | } |
| 244 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 245 | requires_config_value_equals() { |
| 246 | VAL=$( get_config_value_or_default "$1" ) |
| 247 | if [ -z "$VAL" ]; then |
| 248 | # Should never happen |
| 249 | echo "Mbed TLS configuration $1 is not defined" |
| 250 | exit 1 |
| 251 | elif [ "$VAL" -ne "$2" ]; then |
| 252 | SKIP_NEXT="YES" |
| 253 | fi |
| 254 | } |
| 255 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 256 | # Space-separated list of ciphersuites supported by this build of |
| 257 | # Mbed TLS. |
| 258 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
| 259 | grep TLS- | |
| 260 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 261 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 262 | case $P_CIPHERSUITES in |
| 263 | *" $1 "*) :;; |
| 264 | *) SKIP_NEXT="YES";; |
| 265 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 266 | } |
| 267 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 268 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 269 | # If CMD (call to a TLS client or server program) requires a specific |
| 270 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 271 | # enabled. |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 272 | maybe_requires_ciphersuite_enabled() { |
| 273 | case "$1" in |
| 274 | *\ force_ciphersuite=*) :;; |
| 275 | *) return;; # No specific required ciphersuite |
| 276 | esac |
| 277 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 278 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 279 | shift |
| 280 | |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 281 | requires_ciphersuite_enabled "$ciphersuite" |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 282 | |
| 283 | unset ciphersuite |
| 284 | } |
| 285 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 286 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 287 | requires_openssl_with_fallback_scsv() { |
| 288 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 289 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 290 | then |
| 291 | OPENSSL_HAS_FBSCSV="YES" |
| 292 | else |
| 293 | OPENSSL_HAS_FBSCSV="NO" |
| 294 | fi |
| 295 | fi |
| 296 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 297 | SKIP_NEXT="YES" |
| 298 | fi |
| 299 | } |
| 300 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 301 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 302 | requires_max_content_len() { |
| 303 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 304 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 305 | } |
| 306 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 307 | # skip next test if GnuTLS isn't available |
| 308 | requires_gnutls() { |
| 309 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 310 | 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] | 311 | GNUTLS_AVAILABLE="YES" |
| 312 | else |
| 313 | GNUTLS_AVAILABLE="NO" |
| 314 | fi |
| 315 | fi |
| 316 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 317 | SKIP_NEXT="YES" |
| 318 | fi |
| 319 | } |
| 320 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 321 | # skip next test if GnuTLS-next isn't available |
| 322 | requires_gnutls_next() { |
| 323 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 324 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 325 | GNUTLS_NEXT_AVAILABLE="YES" |
| 326 | else |
| 327 | GNUTLS_NEXT_AVAILABLE="NO" |
| 328 | fi |
| 329 | fi |
| 330 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 331 | SKIP_NEXT="YES" |
| 332 | fi |
| 333 | } |
| 334 | |
| 335 | # skip next test if OpenSSL-legacy isn't available |
| 336 | requires_openssl_legacy() { |
| 337 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 338 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 339 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 340 | else |
| 341 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 342 | fi |
| 343 | fi |
| 344 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 345 | SKIP_NEXT="YES" |
| 346 | fi |
| 347 | } |
| 348 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 349 | # skip next test if IPv6 isn't available on this host |
| 350 | requires_ipv6() { |
| 351 | if [ -z "${HAS_IPV6:-}" ]; then |
| 352 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 353 | SRV_PID=$! |
| 354 | sleep 1 |
| 355 | kill $SRV_PID >/dev/null 2>&1 |
| 356 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 357 | HAS_IPV6="NO" |
| 358 | else |
| 359 | HAS_IPV6="YES" |
| 360 | fi |
| 361 | rm -r $SRV_OUT |
| 362 | fi |
| 363 | |
| 364 | if [ "$HAS_IPV6" = "NO" ]; then |
| 365 | SKIP_NEXT="YES" |
| 366 | fi |
| 367 | } |
| 368 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 369 | # skip next test if it's i686 or uname is not available |
| 370 | requires_not_i686() { |
| 371 | if [ -z "${IS_I686:-}" ]; then |
| 372 | IS_I686="YES" |
| 373 | if which "uname" >/dev/null 2>&1; then |
| 374 | if [ -z "$(uname -a | grep i686)" ]; then |
| 375 | IS_I686="NO" |
| 376 | fi |
| 377 | fi |
| 378 | fi |
| 379 | if [ "$IS_I686" = "YES" ]; then |
| 380 | SKIP_NEXT="YES" |
| 381 | fi |
| 382 | } |
| 383 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 384 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 385 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 386 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 387 | 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] | 388 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 389 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 390 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 391 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 392 | fi |
| 393 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 394 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 395 | fi |
| 396 | |
| 397 | # skip the next test if the SSL output buffer is less than 16KB |
| 398 | requires_full_size_output_buffer() { |
| 399 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 400 | SKIP_NEXT="YES" |
| 401 | fi |
| 402 | } |
| 403 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 404 | # skip the next test if valgrind is in use |
| 405 | not_with_valgrind() { |
| 406 | if [ "$MEMCHECK" -gt 0 ]; then |
| 407 | SKIP_NEXT="YES" |
| 408 | fi |
| 409 | } |
| 410 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 411 | # skip the next test if valgrind is NOT in use |
| 412 | only_with_valgrind() { |
| 413 | if [ "$MEMCHECK" -eq 0 ]; then |
| 414 | SKIP_NEXT="YES" |
| 415 | fi |
| 416 | } |
| 417 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 418 | # 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] | 419 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 420 | CLI_DELAY_FACTOR=$1 |
| 421 | } |
| 422 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 423 | # wait for the given seconds after the client finished in the next test |
| 424 | server_needs_more_time() { |
| 425 | SRV_DELAY_SECONDS=$1 |
| 426 | } |
| 427 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 428 | # print_name <name> |
| 429 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 430 | TESTS=$(( $TESTS + 1 )) |
| 431 | LINE="" |
| 432 | |
| 433 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 434 | LINE="$TESTS " |
| 435 | fi |
| 436 | |
| 437 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 438 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 439 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 440 | for i in `seq 1 $LEN`; do printf '.'; done |
| 441 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 442 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 443 | } |
| 444 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 445 | # record_outcome <outcome> [<failure-reason>] |
| 446 | # The test name must be in $NAME. |
| 447 | record_outcome() { |
| 448 | echo "$1" |
| 449 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 450 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 451 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 452 | "ssl-opt" "$NAME" \ |
| 453 | "$1" "${2-}" \ |
| 454 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 455 | fi |
| 456 | } |
| 457 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 458 | # fail <message> |
| 459 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 460 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 461 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 462 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 463 | mv $SRV_OUT o-srv-${TESTS}.log |
| 464 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 465 | if [ -n "$PXY_CMD" ]; then |
| 466 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 467 | fi |
| 468 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 469 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 470 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 471 | echo " ! server output:" |
| 472 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 473 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 474 | echo " ! client output:" |
| 475 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 476 | if [ -n "$PXY_CMD" ]; then |
| 477 | echo " ! ========================================================" |
| 478 | echo " ! proxy output:" |
| 479 | cat o-pxy-${TESTS}.log |
| 480 | fi |
| 481 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 482 | fi |
| 483 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 484 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 485 | } |
| 486 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 487 | # is_polar <cmd_line> |
| 488 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 489 | case "$1" in |
| 490 | *ssl_client2*) true;; |
| 491 | *ssl_server2*) true;; |
| 492 | *) false;; |
| 493 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 494 | } |
| 495 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 496 | # openssl s_server doesn't have -www with DTLS |
| 497 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 498 | case "$SRV_CMD" in |
| 499 | *s_server*-dtls*) |
| 500 | NEEDS_INPUT=1 |
| 501 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 502 | *) NEEDS_INPUT=0;; |
| 503 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 504 | } |
| 505 | |
| 506 | # provide input to commands that need it |
| 507 | provide_input() { |
| 508 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 509 | return |
| 510 | fi |
| 511 | |
| 512 | while true; do |
| 513 | echo "HTTP/1.0 200 OK" |
| 514 | sleep 1 |
| 515 | done |
| 516 | } |
| 517 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 518 | # has_mem_err <log_file_name> |
| 519 | has_mem_err() { |
| 520 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 521 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 522 | then |
| 523 | return 1 # false: does not have errors |
| 524 | else |
| 525 | return 0 # true: has errors |
| 526 | fi |
| 527 | } |
| 528 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 529 | # 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] | 530 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 531 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 532 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 533 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 534 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 535 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 536 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 537 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 538 | # Make a tight loop, server normally takes less than 1s to start. |
| 539 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 540 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 541 | echo "$3 START TIMEOUT" |
| 542 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 543 | break |
| 544 | fi |
| 545 | # Linux and *BSD support decimal arguments to sleep. On other |
| 546 | # OSes this may be a tight loop. |
| 547 | sleep 0.1 2>/dev/null || true |
| 548 | done |
| 549 | } |
| 550 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 551 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 552 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 553 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 554 | } |
| 555 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 556 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 557 | # Wait for server process $2 to be listening on port $1. |
| 558 | wait_server_start() { |
| 559 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 560 | } |
| 561 | |
| 562 | # Wait for proxy process $2 to be listening on port $1. |
| 563 | wait_proxy_start() { |
| 564 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 565 | } |
| 566 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 567 | # 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] | 568 | # 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] | 569 | # acceptable bounds |
| 570 | check_server_hello_time() { |
| 571 | # 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] | 572 | 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] | 573 | # Get the Unix timestamp for now |
| 574 | CUR_TIME=$(date +'%s') |
| 575 | THRESHOLD_IN_SECS=300 |
| 576 | |
| 577 | # Check if the ServerHello time was printed |
| 578 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 579 | return 1 |
| 580 | fi |
| 581 | |
| 582 | # Check the time in ServerHello is within acceptable bounds |
| 583 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 584 | # The time in ServerHello is at least 5 minutes before now |
| 585 | return 1 |
| 586 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 587 | # 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] | 588 | return 1 |
| 589 | else |
| 590 | return 0 |
| 591 | fi |
| 592 | } |
| 593 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 594 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 595 | handshake_memory_get() { |
| 596 | OUTPUT_VARIABLE="$1" |
| 597 | OUTPUT_FILE="$2" |
| 598 | |
| 599 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 600 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 601 | |
| 602 | # Check if memory usage was read |
| 603 | if [ -z "$MEM_USAGE" ]; then |
| 604 | echo "Error: Can not read the value of handshake memory usage" |
| 605 | return 1 |
| 606 | else |
| 607 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 608 | return 0 |
| 609 | fi |
| 610 | } |
| 611 | |
| 612 | # Get handshake memory usage from server or client output and check if this value |
| 613 | # is not higher than the maximum given by the first argument |
| 614 | handshake_memory_check() { |
| 615 | MAX_MEMORY="$1" |
| 616 | OUTPUT_FILE="$2" |
| 617 | |
| 618 | # Get memory usage |
| 619 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 620 | return 1 |
| 621 | fi |
| 622 | |
| 623 | # Check if memory usage is below max value |
| 624 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 625 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 626 | "but should be below $MAX_MEMORY bytes" |
| 627 | return 1 |
| 628 | else |
| 629 | return 0 |
| 630 | fi |
| 631 | } |
| 632 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 633 | # wait for client to terminate and set CLI_EXIT |
| 634 | # must be called right after starting the client |
| 635 | wait_client_done() { |
| 636 | CLI_PID=$! |
| 637 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 638 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 639 | CLI_DELAY_FACTOR=1 |
| 640 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 641 | ( 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] | 642 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 643 | |
| 644 | wait $CLI_PID |
| 645 | CLI_EXIT=$? |
| 646 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 647 | kill $DOG_PID >/dev/null 2>&1 |
| 648 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 649 | |
| 650 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 651 | |
| 652 | sleep $SRV_DELAY_SECONDS |
| 653 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 654 | } |
| 655 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 656 | # check if the given command uses dtls and sets global variable DTLS |
| 657 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 658 | case "$1" in |
| 659 | *dtls=1*|-dtls|-u) DTLS=1;; |
| 660 | *) DTLS=0;; |
| 661 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 662 | } |
| 663 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 664 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 665 | is_gnutls() { |
| 666 | case "$1" in |
| 667 | *gnutls-cli*) |
| 668 | CMD_IS_GNUTLS=1 |
| 669 | ;; |
| 670 | *gnutls-serv*) |
| 671 | CMD_IS_GNUTLS=1 |
| 672 | ;; |
| 673 | *) |
| 674 | CMD_IS_GNUTLS=0 |
| 675 | ;; |
| 676 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 677 | } |
| 678 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 679 | # Compare file content |
| 680 | # Usage: find_in_both pattern file1 file2 |
| 681 | # extract from file1 the first line matching the pattern |
| 682 | # check in file2 that the same line can be found |
| 683 | find_in_both() { |
| 684 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 685 | if [ -z "$srv_pattern" ]; then |
| 686 | return 1; |
| 687 | fi |
| 688 | |
| 689 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 690 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 691 | else |
| 692 | return 1; |
| 693 | fi |
| 694 | } |
| 695 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 696 | SKIP_HANDSHAKE_CHECK="NO" |
| 697 | skip_handshake_stage_check() { |
| 698 | SKIP_HANDSHAKE_CHECK="YES" |
| 699 | } |
| 700 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 701 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 702 | # Options: -s pattern pattern that must be present in server output |
| 703 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 704 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 705 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 706 | # -S pattern pattern that must be absent in server output |
| 707 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 708 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 709 | # -F call shell function on server output |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 710 | # -g call shell function on server and client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 711 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 712 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 713 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 714 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 715 | if is_excluded "$NAME"; then |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 716 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 717 | # There was no request to run the test, so don't record its outcome. |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 718 | return |
| 719 | fi |
| 720 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 721 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 722 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 723 | # Do we only run numbered tests? |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 724 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 725 | case ",$RUN_TEST_NUMBER," in |
| 726 | *",$TESTS,"*) :;; |
| 727 | *) SKIP_NEXT="YES";; |
| 728 | esac |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 729 | fi |
| 730 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 731 | # does this test use a proxy? |
| 732 | if [ "X$1" = "X-p" ]; then |
| 733 | PXY_CMD="$2" |
| 734 | shift 2 |
| 735 | else |
| 736 | PXY_CMD="" |
| 737 | fi |
| 738 | |
| 739 | # get commands and client output |
| 740 | SRV_CMD="$1" |
| 741 | CLI_CMD="$2" |
| 742 | CLI_EXPECT="$3" |
| 743 | shift 3 |
| 744 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 745 | # Check if test uses files |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 746 | case "$SRV_CMD $CLI_CMD" in |
| 747 | *data_files/*) |
| 748 | requires_config_enabled MBEDTLS_FS_IO;; |
| 749 | esac |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 750 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 751 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 752 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 753 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 754 | |
| 755 | # should we skip? |
| 756 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 757 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 758 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 759 | SKIPS=$(( $SKIPS + 1 )) |
| 760 | return |
| 761 | fi |
| 762 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 763 | # update DTLS variable |
| 764 | detect_dtls "$SRV_CMD" |
| 765 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 766 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 767 | # 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] | 768 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 769 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 770 | case " $SRV_CMD " in |
| 771 | *' server_addr=::1 '*) |
| 772 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 773 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 774 | fi |
| 775 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 776 | # update CMD_IS_GNUTLS variable |
| 777 | is_gnutls "$SRV_CMD" |
| 778 | |
| 779 | # if the server uses gnutls but doesn't set priority, explicitly |
| 780 | # set the default priority |
| 781 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 782 | case "$SRV_CMD" in |
| 783 | *--priority*) :;; |
| 784 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 785 | esac |
| 786 | fi |
| 787 | |
| 788 | # update CMD_IS_GNUTLS variable |
| 789 | is_gnutls "$CLI_CMD" |
| 790 | |
| 791 | # if the client uses gnutls but doesn't set priority, explicitly |
| 792 | # set the default priority |
| 793 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 794 | case "$CLI_CMD" in |
| 795 | *--priority*) :;; |
| 796 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 797 | esac |
| 798 | fi |
| 799 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 800 | # fix client port |
| 801 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 802 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 803 | else |
| 804 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 805 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 806 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 807 | # prepend valgrind to our commands if active |
| 808 | if [ "$MEMCHECK" -gt 0 ]; then |
| 809 | if is_polar "$SRV_CMD"; then |
| 810 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 811 | fi |
| 812 | if is_polar "$CLI_CMD"; then |
| 813 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 814 | fi |
| 815 | fi |
| 816 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 817 | TIMES_LEFT=2 |
| 818 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 819 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 820 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 821 | # run the commands |
| 822 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a3b994f | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 823 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 824 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 825 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 826 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 827 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 828 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 829 | check_osrv_dtls |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 830 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 831 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 832 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 833 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 834 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 835 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 836 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 837 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 838 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 839 | sleep 0.05 |
| 840 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 841 | # terminate the server (and the proxy) |
| 842 | kill $SRV_PID |
| 843 | wait $SRV_PID |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 844 | SRV_RET=$? |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 845 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 846 | if [ -n "$PXY_CMD" ]; then |
| 847 | kill $PXY_PID >/dev/null 2>&1 |
| 848 | wait $PXY_PID |
| 849 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 850 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 851 | # retry only on timeouts |
| 852 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 853 | printf "RETRY " |
| 854 | else |
| 855 | TIMES_LEFT=0 |
| 856 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 857 | done |
| 858 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 859 | # 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] | 860 | # (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] | 861 | # expected client exit to incorrectly succeed in case of catastrophic |
| 862 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 863 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 864 | then |
| 865 | if is_polar "$SRV_CMD"; then |
| 866 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 867 | else |
| 868 | fail "server or client failed to reach handshake stage" |
| 869 | return |
| 870 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 871 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 872 | if is_polar "$CLI_CMD"; then |
| 873 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 874 | else |
| 875 | fail "server or client failed to reach handshake stage" |
| 876 | return |
| 877 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 878 | fi |
| 879 | fi |
| 880 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 881 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 882 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 883 | # exit with status 0 when interrupted by a signal, and we don't really |
| 884 | # care anyway), in case e.g. the server reports a memory leak. |
| 885 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 886 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 887 | return |
| 888 | fi |
| 889 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 890 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 891 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 892 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 893 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 894 | 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] | 895 | return |
| 896 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 897 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 898 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 899 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 900 | # 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] | 901 | while [ $# -gt 0 ] |
| 902 | do |
| 903 | case $1 in |
| 904 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 905 | 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] | 906 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 907 | return |
| 908 | fi |
| 909 | ;; |
| 910 | |
| 911 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 912 | 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] | 913 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 914 | return |
| 915 | fi |
| 916 | ;; |
| 917 | |
| 918 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 919 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 920 | fail "pattern '$2' MUST NOT be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 921 | return |
| 922 | fi |
| 923 | ;; |
| 924 | |
| 925 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 926 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 927 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 928 | return |
| 929 | fi |
| 930 | ;; |
| 931 | |
| 932 | # The filtering in the following two options (-u and -U) do the following |
| 933 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 934 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 935 | # - keep one of each non-unique line |
| 936 | # - count how many lines remain |
| 937 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 938 | # if there were no duplicates. |
| 939 | "-U") |
| 940 | 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 |
| 941 | fail "lines following pattern '$2' must be unique in Server output" |
| 942 | return |
| 943 | fi |
| 944 | ;; |
| 945 | |
| 946 | "-u") |
| 947 | 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 |
| 948 | 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] | 949 | return |
| 950 | fi |
| 951 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 952 | "-F") |
| 953 | if ! $2 "$SRV_OUT"; then |
| 954 | fail "function call to '$2' failed on Server output" |
| 955 | return |
| 956 | fi |
| 957 | ;; |
| 958 | "-f") |
| 959 | if ! $2 "$CLI_OUT"; then |
| 960 | fail "function call to '$2' failed on Client output" |
| 961 | return |
| 962 | fi |
| 963 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 964 | "-g") |
| 965 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 966 | fail "function call to '$2' failed on Server and Client output" |
| 967 | return |
| 968 | fi |
| 969 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 970 | |
| 971 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 972 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 973 | exit 1 |
| 974 | esac |
| 975 | shift 2 |
| 976 | done |
| 977 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 978 | # check valgrind's results |
| 979 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 980 | 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] | 981 | fail "Server has memory errors" |
| 982 | return |
| 983 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 984 | 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] | 985 | fail "Client has memory errors" |
| 986 | return |
| 987 | fi |
| 988 | fi |
| 989 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 990 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 991 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 992 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 993 | mv $SRV_OUT o-srv-${TESTS}.log |
| 994 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 995 | if [ -n "$PXY_CMD" ]; then |
| 996 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 997 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 998 | fi |
| 999 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1000 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1001 | } |
| 1002 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1003 | run_test_psa() { |
| 1004 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1005 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 1006 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 1007 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1008 | 0 \ |
| 1009 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1010 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1011 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1012 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1013 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1014 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1015 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1016 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1017 | -C "Failed to setup PSA-based cipher context"\ |
| 1018 | -S "Failed to setup PSA-based cipher context"\ |
| 1019 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1020 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1021 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1022 | -S "error" \ |
| 1023 | -C "error" |
| 1024 | } |
| 1025 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1026 | run_test_psa_force_curve() { |
| 1027 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1028 | run_test "PSA - ECDH with $1" \ |
Gilles Peskine | 12b5b38 | 2021-06-02 10:00:42 +0200 | [diff] [blame] | 1029 | "$P_SRV debug_level=4 force_version=tls1_2 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1030 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 1031 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1032 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1033 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1034 | -c "PSA calc verify" \ |
| 1035 | -c "calc PSA finished" \ |
| 1036 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1037 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1038 | -s "PSA calc verify" \ |
| 1039 | -s "calc PSA finished" \ |
| 1040 | -C "Failed to setup PSA-based cipher context"\ |
| 1041 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1042 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1043 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1044 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1045 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1046 | -C "error" |
| 1047 | } |
| 1048 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1049 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1050 | # a maximum fragment length. |
| 1051 | # first argument ($1) is MFL for SSL client |
| 1052 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1053 | run_test_memory_after_hanshake_with_mfl() |
| 1054 | { |
| 1055 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1056 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1057 | |
| 1058 | # Leave some margin for robustness |
| 1059 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1060 | |
| 1061 | run_test "Handshake memory usage (MFL $1)" \ |
| 1062 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1063 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1064 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1065 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1066 | 0 \ |
| 1067 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1068 | } |
| 1069 | |
| 1070 | |
| 1071 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1072 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1073 | run_tests_memory_after_hanshake() |
| 1074 | { |
| 1075 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1076 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1077 | |
| 1078 | # first test with default MFU is to get reference memory usage |
| 1079 | MEMORY_USAGE_MFL_16K=0 |
| 1080 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1081 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1082 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1083 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1084 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1085 | 0 \ |
| 1086 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1087 | |
| 1088 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1089 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1090 | |
| 1091 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1092 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1093 | |
| 1094 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1095 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1096 | |
| 1097 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1098 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1099 | } |
| 1100 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1101 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1102 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1103 | rm -f context_srv.txt |
| 1104 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1105 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1106 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1107 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1108 | 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] | 1109 | exit 1 |
| 1110 | } |
| 1111 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1112 | # |
| 1113 | # MAIN |
| 1114 | # |
| 1115 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1116 | get_options "$@" |
| 1117 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1118 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1119 | # patterns rather than regular expressions, use a case statement instead |
| 1120 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1121 | # detects simple cases: plain substring, everything, nothing. |
| 1122 | # |
| 1123 | # As an exception, the character '.' is treated as an ordinary character |
| 1124 | # if it is the only special character in the string. This is because it's |
| 1125 | # rare to need "any one character", but needing a literal '.' is common |
| 1126 | # (e.g. '-f "DTLS 1.2"'). |
| 1127 | need_grep= |
| 1128 | case "$FILTER" in |
| 1129 | '^$') simple_filter=;; |
| 1130 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1131 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1132 | need_grep=1;; |
| 1133 | *) # No regexp or shell-pattern special character |
| 1134 | simple_filter="*$FILTER*";; |
| 1135 | esac |
| 1136 | case "$EXCLUDE" in |
| 1137 | '^$') simple_exclude=;; |
| 1138 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1139 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1140 | need_grep=1;; |
| 1141 | *) # No regexp or shell-pattern special character |
| 1142 | simple_exclude="*$EXCLUDE*";; |
| 1143 | esac |
| 1144 | if [ -n "$need_grep" ]; then |
| 1145 | is_excluded () { |
| 1146 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1147 | } |
| 1148 | else |
| 1149 | is_excluded () { |
| 1150 | case "$1" in |
| 1151 | $simple_exclude) true;; |
| 1152 | $simple_filter) false;; |
| 1153 | *) true;; |
| 1154 | esac |
| 1155 | } |
| 1156 | fi |
| 1157 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1158 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1159 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1160 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1161 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1162 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1163 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1164 | exit 1 |
| 1165 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1166 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1167 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1168 | exit 1 |
| 1169 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1170 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1171 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1172 | exit 1 |
| 1173 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1174 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1175 | if which valgrind >/dev/null 2>&1; then :; else |
| 1176 | echo "Memcheck not possible. Valgrind not found" |
| 1177 | exit 1 |
| 1178 | fi |
| 1179 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1180 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1181 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1182 | exit 1 |
| 1183 | fi |
| 1184 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1185 | # used by watchdog |
| 1186 | MAIN_PID="$$" |
| 1187 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1188 | # We use somewhat arbitrary delays for tests: |
| 1189 | # - how long do we wait for the server to start (when lsof not available)? |
| 1190 | # - how long do we allow for the client to finish? |
| 1191 | # (not to check performance, just to avoid waiting indefinitely) |
| 1192 | # Things are slower with valgrind, so give extra time here. |
| 1193 | # |
| 1194 | # Note: without lsof, there is a trade-off between the running time of this |
| 1195 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1196 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1197 | # 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] | 1198 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1199 | START_DELAY=6 |
| 1200 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1201 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1202 | START_DELAY=2 |
| 1203 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1204 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1205 | |
| 1206 | # some particular tests need more time: |
| 1207 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1208 | # - for the server, we sleep for a number of seconds after the client exits |
| 1209 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1210 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1211 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1212 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1213 | # 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] | 1214 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1215 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1216 | 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] | 1217 | 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] | 1218 | O_SRV="$O_SRV -accept $SRV_PORT" |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 1219 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1220 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1221 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1222 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1223 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1224 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1225 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1226 | fi |
| 1227 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1228 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1229 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1230 | fi |
| 1231 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1232 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1233 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1234 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1235 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1236 | # Allow SHA-1, because many of our test certificates use it |
| 1237 | P_SRV="$P_SRV allow_sha1=1" |
| 1238 | P_CLI="$P_CLI allow_sha1=1" |
| 1239 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1240 | # Also pick a unique name for intermediate files |
| 1241 | SRV_OUT="srv_out.$$" |
| 1242 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1243 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1244 | SESSION="session.$$" |
| 1245 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1246 | SKIP_NEXT="NO" |
| 1247 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1248 | trap cleanup INT TERM HUP |
| 1249 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1250 | # Basic test |
| 1251 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1252 | # Checks that: |
| 1253 | # - 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] | 1254 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1255 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1256 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1257 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1258 | "$P_CLI" \ |
| 1259 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1260 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1261 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1262 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1263 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1264 | -S "error" \ |
| 1265 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1266 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1267 | run_test "Default, DTLS" \ |
| 1268 | "$P_SRV dtls=1" \ |
| 1269 | "$P_CLI dtls=1" \ |
| 1270 | 0 \ |
| 1271 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1272 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1273 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1274 | run_test "TLS client auth: required" \ |
| 1275 | "$P_SRV auth_mode=required" \ |
| 1276 | "$P_CLI" \ |
| 1277 | 0 \ |
| 1278 | -s "Verifying peer X.509 certificate... ok" |
| 1279 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1280 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1281 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1282 | requires_config_enabled MBEDTLS_SHA256_C |
| 1283 | run_test "TLS: password protected client key" \ |
| 1284 | "$P_SRV auth_mode=required" \ |
| 1285 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1286 | 0 |
| 1287 | |
| 1288 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1289 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1290 | requires_config_enabled MBEDTLS_SHA256_C |
| 1291 | run_test "TLS: password protected server key" \ |
| 1292 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1293 | "$P_CLI" \ |
| 1294 | 0 |
| 1295 | |
| 1296 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1297 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1298 | requires_config_enabled MBEDTLS_RSA_C |
| 1299 | requires_config_enabled MBEDTLS_SHA256_C |
| 1300 | run_test "TLS: password protected server key, two certificates" \ |
| 1301 | "$P_SRV \ |
| 1302 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1303 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1304 | "$P_CLI" \ |
| 1305 | 0 |
| 1306 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1307 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1308 | run_test "CA callback on client" \ |
| 1309 | "$P_SRV debug_level=3" \ |
| 1310 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1311 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1312 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1313 | -S "error" \ |
| 1314 | -C "error" |
| 1315 | |
| 1316 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1317 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1318 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1319 | requires_config_enabled MBEDTLS_SHA256_C |
| 1320 | run_test "CA callback on server" \ |
| 1321 | "$P_SRV auth_mode=required" \ |
| 1322 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1323 | key_file=data_files/server5.key" \ |
| 1324 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1325 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1326 | -s "Verifying peer X.509 certificate... ok" \ |
| 1327 | -S "error" \ |
| 1328 | -C "error" |
| 1329 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1330 | # Test using an opaque private key for client authentication |
| 1331 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1332 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1333 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1334 | requires_config_enabled MBEDTLS_SHA256_C |
| 1335 | run_test "Opaque key for client authentication" \ |
| 1336 | "$P_SRV auth_mode=required" \ |
| 1337 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1338 | key_file=data_files/server5.key" \ |
| 1339 | 0 \ |
| 1340 | -c "key type: Opaque" \ |
| 1341 | -s "Verifying peer X.509 certificate... ok" \ |
| 1342 | -S "error" \ |
| 1343 | -C "error" |
| 1344 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1345 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1346 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1347 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1348 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1349 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1350 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1351 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1352 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1353 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1354 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1355 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1356 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1357 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1358 | run_test_psa_force_curve "secp521r1" |
| 1359 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1360 | run_test_psa_force_curve "brainpoolP512r1" |
| 1361 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1362 | run_test_psa_force_curve "secp384r1" |
| 1363 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1364 | run_test_psa_force_curve "brainpoolP384r1" |
| 1365 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1366 | run_test_psa_force_curve "secp256r1" |
| 1367 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1368 | run_test_psa_force_curve "secp256k1" |
| 1369 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1370 | run_test_psa_force_curve "brainpoolP256r1" |
| 1371 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1372 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1373 | ## SECP224K1 is buggy via the PSA API |
| 1374 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1375 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1376 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1377 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1378 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1379 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1380 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1381 | run_test_psa_force_curve "secp192r1" |
| 1382 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1383 | run_test_psa_force_curve "secp192k1" |
| 1384 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1385 | # Test current time in ServerHello |
| 1386 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1387 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1388 | "$P_SRV debug_level=3" \ |
| 1389 | "$P_CLI debug_level=3" \ |
| 1390 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1391 | -f "check_server_hello_time" \ |
| 1392 | -F "check_server_hello_time" |
| 1393 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1394 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1395 | run_test "Unique IV in GCM" \ |
| 1396 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1397 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1398 | 0 \ |
| 1399 | -u "IV used" \ |
| 1400 | -U "IV used" |
| 1401 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1402 | # Tests for certificate verification callback |
| 1403 | run_test "Configuration-specific CRT verification callback" \ |
| 1404 | "$P_SRV debug_level=3" \ |
| 1405 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1406 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1407 | -S "error" \ |
| 1408 | -c "Verify requested for " \ |
| 1409 | -c "Use configuration-specific verification callback" \ |
| 1410 | -C "Use context-specific verification callback" \ |
| 1411 | -C "error" |
| 1412 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1413 | run_test "Context-specific CRT verification callback" \ |
| 1414 | "$P_SRV debug_level=3" \ |
| 1415 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1416 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1417 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1418 | -c "Verify requested for " \ |
| 1419 | -c "Use context-specific verification callback" \ |
| 1420 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1421 | -C "error" |
| 1422 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1423 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1424 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1425 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1426 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1427 | 1 \ |
| 1428 | -c "The certificate is signed with an unacceptable hash" |
| 1429 | |
| 1430 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1431 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1432 | "$P_CLI allow_sha1=1" \ |
| 1433 | 0 |
| 1434 | |
| 1435 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1436 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1437 | "$P_CLI allow_sha1=0" \ |
| 1438 | 0 |
| 1439 | |
| 1440 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1441 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1442 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1443 | 1 \ |
| 1444 | -s "The certificate is signed with an unacceptable hash" |
| 1445 | |
| 1446 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1447 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1448 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1449 | 0 |
| 1450 | |
| 1451 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1452 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1453 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1454 | 0 |
| 1455 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame^] | 1456 | # Dummy TLS 1.3 test |
| 1457 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1458 | # ssl_client2/ssl_server2 example programs works. |
| 1459 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1460 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
| 1461 | "$P_SRV tls13_kex_modes=psk_pure" \ |
| 1462 | "$P_CLI tls13_kex_modes=psk_pure" \ |
| 1463 | 0 |
| 1464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1465 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1466 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1467 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1468 | 0 |
| 1469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1470 | run_test "TLS 1.3, key exchange mode parameter passing: Pure-ephemeral only" \ |
| 1471 | "$P_SRV tls13_kex_modes=ephemeral_pure" \ |
| 1472 | "$P_CLI tls13_kex_modes=ephemeral_pure" \ |
| 1473 | 0 |
| 1474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1475 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1476 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1477 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1478 | 0 |
| 1479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1480 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1481 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1482 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1483 | 0 |
| 1484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1485 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1486 | "$P_SRV tls13_kex_modes=all" \ |
| 1487 | "$P_CLI tls13_kex_modes=all" \ |
| 1488 | 0 |
| 1489 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1490 | # Tests for datagram packing |
| 1491 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1492 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1493 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1494 | 0 \ |
| 1495 | -c "next record in same datagram" \ |
| 1496 | -s "next record in same datagram" |
| 1497 | |
| 1498 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1499 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1500 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1501 | 0 \ |
| 1502 | -s "next record in same datagram" \ |
| 1503 | -C "next record in same datagram" |
| 1504 | |
| 1505 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1506 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1507 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1508 | 0 \ |
| 1509 | -S "next record in same datagram" \ |
| 1510 | -c "next record in same datagram" |
| 1511 | |
| 1512 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1513 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1514 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1515 | 0 \ |
| 1516 | -S "next record in same datagram" \ |
| 1517 | -C "next record in same datagram" |
| 1518 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1519 | # Tests for Context serialization |
| 1520 | |
| 1521 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1522 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1523 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1524 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1525 | 0 \ |
| 1526 | -c "Deserializing connection..." \ |
| 1527 | -S "Deserializing connection..." |
| 1528 | |
| 1529 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1530 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1531 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1532 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1533 | 0 \ |
| 1534 | -c "Deserializing connection..." \ |
| 1535 | -S "Deserializing connection..." |
| 1536 | |
| 1537 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1538 | run_test "Context serialization, client serializes, GCM" \ |
| 1539 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1540 | "$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] | 1541 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1542 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1543 | -S "Deserializing connection..." |
| 1544 | |
| 1545 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1546 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1547 | run_test "Context serialization, client serializes, with CID" \ |
| 1548 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1549 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1550 | 0 \ |
| 1551 | -c "Deserializing connection..." \ |
| 1552 | -S "Deserializing connection..." |
| 1553 | |
| 1554 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1555 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1556 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1557 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1558 | 0 \ |
| 1559 | -C "Deserializing connection..." \ |
| 1560 | -s "Deserializing connection..." |
| 1561 | |
| 1562 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1563 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1564 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1565 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1566 | 0 \ |
| 1567 | -C "Deserializing connection..." \ |
| 1568 | -s "Deserializing connection..." |
| 1569 | |
| 1570 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1571 | run_test "Context serialization, server serializes, GCM" \ |
| 1572 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1573 | "$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] | 1574 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1575 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1576 | -s "Deserializing connection..." |
| 1577 | |
| 1578 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1579 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1580 | run_test "Context serialization, server serializes, with CID" \ |
| 1581 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1582 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1583 | 0 \ |
| 1584 | -C "Deserializing connection..." \ |
| 1585 | -s "Deserializing connection..." |
| 1586 | |
| 1587 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1588 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1589 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1590 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1591 | 0 \ |
| 1592 | -c "Deserializing connection..." \ |
| 1593 | -s "Deserializing connection..." |
| 1594 | |
| 1595 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1596 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1597 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1598 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1599 | 0 \ |
| 1600 | -c "Deserializing connection..." \ |
| 1601 | -s "Deserializing connection..." |
| 1602 | |
| 1603 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1604 | run_test "Context serialization, both serialize, GCM" \ |
| 1605 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1606 | "$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] | 1607 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1608 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1609 | -s "Deserializing connection..." |
| 1610 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1611 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1612 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1613 | run_test "Context serialization, both serialize, with CID" \ |
| 1614 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1615 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1616 | 0 \ |
| 1617 | -c "Deserializing connection..." \ |
| 1618 | -s "Deserializing connection..." |
| 1619 | |
| 1620 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1621 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1622 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1623 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1624 | 0 \ |
| 1625 | -c "Deserializing connection..." \ |
| 1626 | -S "Deserializing connection..." |
| 1627 | |
| 1628 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1629 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1630 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1631 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1632 | 0 \ |
| 1633 | -c "Deserializing connection..." \ |
| 1634 | -S "Deserializing connection..." |
| 1635 | |
| 1636 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1637 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1638 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1639 | "$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] | 1640 | 0 \ |
| 1641 | -c "Deserializing connection..." \ |
| 1642 | -S "Deserializing connection..." |
| 1643 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1644 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1645 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1646 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1647 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1648 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1649 | 0 \ |
| 1650 | -c "Deserializing connection..." \ |
| 1651 | -S "Deserializing connection..." |
| 1652 | |
| 1653 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1654 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1655 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1656 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1657 | 0 \ |
| 1658 | -C "Deserializing connection..." \ |
| 1659 | -s "Deserializing connection..." |
| 1660 | |
| 1661 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1662 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1663 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1664 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1665 | 0 \ |
| 1666 | -C "Deserializing connection..." \ |
| 1667 | -s "Deserializing connection..." |
| 1668 | |
| 1669 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1670 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1671 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1672 | "$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] | 1673 | 0 \ |
| 1674 | -C "Deserializing connection..." \ |
| 1675 | -s "Deserializing connection..." |
| 1676 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1677 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1678 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1679 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1680 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1681 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1682 | 0 \ |
| 1683 | -C "Deserializing connection..." \ |
| 1684 | -s "Deserializing connection..." |
| 1685 | |
| 1686 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1687 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1688 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1689 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1690 | 0 \ |
| 1691 | -c "Deserializing connection..." \ |
| 1692 | -s "Deserializing connection..." |
| 1693 | |
| 1694 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1695 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1696 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1697 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1698 | 0 \ |
| 1699 | -c "Deserializing connection..." \ |
| 1700 | -s "Deserializing connection..." |
| 1701 | |
| 1702 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1703 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1704 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1705 | "$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] | 1706 | 0 \ |
| 1707 | -c "Deserializing connection..." \ |
| 1708 | -s "Deserializing connection..." |
| 1709 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1710 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1711 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1712 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1713 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1714 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1715 | 0 \ |
| 1716 | -c "Deserializing connection..." \ |
| 1717 | -s "Deserializing connection..." |
| 1718 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1719 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1720 | run_test "Saving the serialized context to a file" \ |
| 1721 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1722 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1723 | 0 \ |
| 1724 | -s "Save serialized context to a file... ok" \ |
| 1725 | -c "Save serialized context to a file... ok" |
| 1726 | rm -f context_srv.txt |
| 1727 | rm -f context_cli.txt |
| 1728 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1729 | # Tests for DTLS Connection ID extension |
| 1730 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1731 | # So far, the CID API isn't implemented, so we can't |
| 1732 | # grep for output witnessing its use. This needs to be |
| 1733 | # changed once the CID extension is implemented. |
| 1734 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1735 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1736 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1737 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1738 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1739 | 0 \ |
| 1740 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1741 | -s "found CID extension" \ |
| 1742 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1743 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1744 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1745 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1746 | -C "found CID extension" \ |
| 1747 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1748 | -C "Copy CIDs into SSL transform" \ |
| 1749 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1750 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1751 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1752 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1753 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1754 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1755 | 0 \ |
| 1756 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1757 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1758 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1759 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1760 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1761 | -C "found CID extension" \ |
| 1762 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1763 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1764 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1765 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1766 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1767 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1768 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1769 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1770 | 0 \ |
| 1771 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1772 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1773 | -c "client hello, adding CID extension" \ |
| 1774 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1775 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1776 | -s "server hello, adding CID extension" \ |
| 1777 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1778 | -c "Use of CID extension negotiated" \ |
| 1779 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1780 | -c "Copy CIDs into SSL transform" \ |
| 1781 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1782 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1783 | -s "Use of Connection ID has been negotiated" \ |
| 1784 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1785 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1786 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1787 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1788 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1789 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1790 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1791 | 0 \ |
| 1792 | -c "Enable use of CID extension." \ |
| 1793 | -s "Enable use of CID extension." \ |
| 1794 | -c "client hello, adding CID extension" \ |
| 1795 | -s "found CID extension" \ |
| 1796 | -s "Use of CID extension negotiated" \ |
| 1797 | -s "server hello, adding CID extension" \ |
| 1798 | -c "found CID extension" \ |
| 1799 | -c "Use of CID extension negotiated" \ |
| 1800 | -s "Copy CIDs into SSL transform" \ |
| 1801 | -c "Copy CIDs into SSL transform" \ |
| 1802 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1803 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1804 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1805 | -c "Use of Connection ID has been negotiated" \ |
| 1806 | -c "ignoring unexpected CID" \ |
| 1807 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1808 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1809 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1810 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1811 | -p "$P_PXY mtu=800" \ |
| 1812 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1813 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1814 | 0 \ |
| 1815 | -c "Enable use of CID extension." \ |
| 1816 | -s "Enable use of CID extension." \ |
| 1817 | -c "client hello, adding CID extension" \ |
| 1818 | -s "found CID extension" \ |
| 1819 | -s "Use of CID extension negotiated" \ |
| 1820 | -s "server hello, adding CID extension" \ |
| 1821 | -c "found CID extension" \ |
| 1822 | -c "Use of CID extension negotiated" \ |
| 1823 | -s "Copy CIDs into SSL transform" \ |
| 1824 | -c "Copy CIDs into SSL transform" \ |
| 1825 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1826 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1827 | -s "Use of Connection ID has been negotiated" \ |
| 1828 | -c "Use of Connection ID has been negotiated" |
| 1829 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1830 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1831 | 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] | 1832 | -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] | 1833 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1834 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1835 | 0 \ |
| 1836 | -c "Enable use of CID extension." \ |
| 1837 | -s "Enable use of CID extension." \ |
| 1838 | -c "client hello, adding CID extension" \ |
| 1839 | -s "found CID extension" \ |
| 1840 | -s "Use of CID extension negotiated" \ |
| 1841 | -s "server hello, adding CID extension" \ |
| 1842 | -c "found CID extension" \ |
| 1843 | -c "Use of CID extension negotiated" \ |
| 1844 | -s "Copy CIDs into SSL transform" \ |
| 1845 | -c "Copy CIDs into SSL transform" \ |
| 1846 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1847 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1848 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1849 | -c "Use of Connection ID has been negotiated" \ |
| 1850 | -c "ignoring unexpected CID" \ |
| 1851 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1852 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1853 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1854 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1855 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1856 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1857 | 0 \ |
| 1858 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1859 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1860 | -c "client hello, adding CID extension" \ |
| 1861 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1862 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1863 | -s "server hello, adding CID extension" \ |
| 1864 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1865 | -c "Use of CID extension negotiated" \ |
| 1866 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1867 | -c "Copy CIDs into SSL transform" \ |
| 1868 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1869 | -s "Peer CID (length 0 Bytes):" \ |
| 1870 | -s "Use of Connection ID has been negotiated" \ |
| 1871 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1872 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1873 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1874 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1875 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1876 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1877 | 0 \ |
| 1878 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1879 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1880 | -c "client hello, adding CID extension" \ |
| 1881 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1882 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1883 | -s "server hello, adding CID extension" \ |
| 1884 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1885 | -c "Use of CID extension negotiated" \ |
| 1886 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1887 | -c "Copy CIDs into SSL transform" \ |
| 1888 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1889 | -c "Peer CID (length 0 Bytes):" \ |
| 1890 | -s "Use of Connection ID has been negotiated" \ |
| 1891 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1892 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1893 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1894 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1895 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1896 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1897 | 0 \ |
| 1898 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1899 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1900 | -c "client hello, adding CID extension" \ |
| 1901 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1902 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1903 | -s "server hello, adding CID extension" \ |
| 1904 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1905 | -c "Use of CID extension negotiated" \ |
| 1906 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1907 | -c "Copy CIDs into SSL transform" \ |
| 1908 | -S "Use of Connection ID has been negotiated" \ |
| 1909 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1910 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1911 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1912 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1913 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1914 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1915 | 0 \ |
| 1916 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1917 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1918 | -c "client hello, adding CID extension" \ |
| 1919 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1920 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1921 | -s "server hello, adding CID extension" \ |
| 1922 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1923 | -c "Use of CID extension negotiated" \ |
| 1924 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1925 | -c "Copy CIDs into SSL transform" \ |
| 1926 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1927 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1928 | -s "Use of Connection ID has been negotiated" \ |
| 1929 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1930 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1931 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1932 | 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] | 1933 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1934 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1935 | 0 \ |
| 1936 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1937 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1938 | -c "client hello, adding CID extension" \ |
| 1939 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1940 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1941 | -s "server hello, adding CID extension" \ |
| 1942 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1943 | -c "Use of CID extension negotiated" \ |
| 1944 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1945 | -c "Copy CIDs into SSL transform" \ |
| 1946 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1947 | -s "Peer CID (length 0 Bytes):" \ |
| 1948 | -s "Use of Connection ID has been negotiated" \ |
| 1949 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1950 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1951 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1952 | 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] | 1953 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1954 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1955 | 0 \ |
| 1956 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1957 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1958 | -c "client hello, adding CID extension" \ |
| 1959 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1960 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1961 | -s "server hello, adding CID extension" \ |
| 1962 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1963 | -c "Use of CID extension negotiated" \ |
| 1964 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1965 | -c "Copy CIDs into SSL transform" \ |
| 1966 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1967 | -c "Peer CID (length 0 Bytes):" \ |
| 1968 | -s "Use of Connection ID has been negotiated" \ |
| 1969 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1970 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1971 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1972 | 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] | 1973 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1974 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1975 | 0 \ |
| 1976 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1977 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1978 | -c "client hello, adding CID extension" \ |
| 1979 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1980 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1981 | -s "server hello, adding CID extension" \ |
| 1982 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1983 | -c "Use of CID extension negotiated" \ |
| 1984 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1985 | -c "Copy CIDs into SSL transform" \ |
| 1986 | -S "Use of Connection ID has been negotiated" \ |
| 1987 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1988 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1989 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1990 | 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] | 1991 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1992 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1993 | 0 \ |
| 1994 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1995 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1996 | -c "client hello, adding CID extension" \ |
| 1997 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1998 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1999 | -s "server hello, adding CID extension" \ |
| 2000 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2001 | -c "Use of CID extension negotiated" \ |
| 2002 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2003 | -c "Copy CIDs into SSL transform" \ |
| 2004 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2005 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2006 | -s "Use of Connection ID has been negotiated" \ |
| 2007 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2008 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2009 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2010 | 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] | 2011 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2012 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2013 | 0 \ |
| 2014 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2015 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2016 | -c "client hello, adding CID extension" \ |
| 2017 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2018 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2019 | -s "server hello, adding CID extension" \ |
| 2020 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2021 | -c "Use of CID extension negotiated" \ |
| 2022 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2023 | -c "Copy CIDs into SSL transform" \ |
| 2024 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2025 | -s "Peer CID (length 0 Bytes):" \ |
| 2026 | -s "Use of Connection ID has been negotiated" \ |
| 2027 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2028 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2029 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2030 | 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] | 2031 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2032 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2033 | 0 \ |
| 2034 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2035 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2036 | -c "client hello, adding CID extension" \ |
| 2037 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2038 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2039 | -s "server hello, adding CID extension" \ |
| 2040 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2041 | -c "Use of CID extension negotiated" \ |
| 2042 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2043 | -c "Copy CIDs into SSL transform" \ |
| 2044 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2045 | -c "Peer CID (length 0 Bytes):" \ |
| 2046 | -s "Use of Connection ID has been negotiated" \ |
| 2047 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2048 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2049 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2050 | 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] | 2051 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2052 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2053 | 0 \ |
| 2054 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2055 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2056 | -c "client hello, adding CID extension" \ |
| 2057 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2058 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2059 | -s "server hello, adding CID extension" \ |
| 2060 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2061 | -c "Use of CID extension negotiated" \ |
| 2062 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2063 | -c "Copy CIDs into SSL transform" \ |
| 2064 | -S "Use of Connection ID has been negotiated" \ |
| 2065 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2066 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2067 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2068 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2069 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2070 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2071 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2072 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2073 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2074 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2075 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2076 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2077 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2078 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2079 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2080 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2081 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2082 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2083 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2084 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2085 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2086 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2087 | 0 \ |
| 2088 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2089 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2090 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2091 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2092 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2093 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2094 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2095 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2096 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2097 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2098 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2099 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2100 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2101 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2102 | 0 \ |
| 2103 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2104 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2105 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2106 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2107 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2108 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2109 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2110 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2111 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2112 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2113 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2114 | 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] | 2115 | -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] | 2116 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2117 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2118 | 0 \ |
| 2119 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2120 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2121 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2122 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2123 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2124 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2125 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2126 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2127 | -c "ignoring unexpected CID" \ |
| 2128 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2129 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2130 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2131 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2132 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2133 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2134 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2135 | 0 \ |
| 2136 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2137 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2138 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2139 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2140 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2141 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2142 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2143 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2144 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2145 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2146 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2147 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2148 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2149 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2150 | 0 \ |
| 2151 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2152 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2153 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2154 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2155 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2156 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2157 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2158 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2159 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2160 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2161 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2162 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2163 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2164 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2165 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2166 | 0 \ |
| 2167 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2168 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2169 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2170 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2171 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2172 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2173 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2174 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2175 | -c "ignoring unexpected CID" \ |
| 2176 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2177 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2178 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2179 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2180 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2181 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2182 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2183 | 0 \ |
| 2184 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2185 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2186 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2187 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2188 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2189 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2190 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2191 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2192 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2193 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2194 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2195 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2196 | 0 \ |
| 2197 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2198 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2199 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2200 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2201 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2202 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2203 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2204 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2205 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2206 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2207 | -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] | 2208 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2209 | "$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" \ |
| 2210 | 0 \ |
| 2211 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2212 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2213 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2214 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2215 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2216 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2217 | -c "ignoring unexpected CID" \ |
| 2218 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2219 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2220 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2221 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2222 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2223 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2224 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2225 | 0 \ |
| 2226 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2227 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2228 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2229 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2230 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2231 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2232 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2233 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2234 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2235 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2236 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2237 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2238 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2239 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2240 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2241 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2242 | 0 \ |
| 2243 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2244 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2245 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2246 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2247 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2248 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2249 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2250 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2251 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2252 | -c "ignoring unexpected CID" \ |
| 2253 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2254 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2255 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2256 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2257 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2258 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2259 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2260 | 0 \ |
| 2261 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2262 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2263 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2264 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2265 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2266 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2267 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2268 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2269 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2270 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2271 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2272 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2273 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2274 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2275 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2276 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2277 | 0 \ |
| 2278 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2279 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2280 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2281 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2282 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2283 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2284 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2285 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2286 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2287 | -c "ignoring unexpected CID" \ |
| 2288 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2289 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2290 | # 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] | 2291 | # tests check that the buffer contents are reallocated when the message is |
| 2292 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2293 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2294 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2295 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2296 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2297 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2298 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2299 | 0 \ |
| 2300 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2301 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2302 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2303 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2304 | -s "Reallocating in_buf" \ |
| 2305 | -s "Reallocating out_buf" |
| 2306 | |
| 2307 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2308 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2309 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2310 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2311 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2312 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2313 | 0 \ |
| 2314 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2315 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2316 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2317 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2318 | -s "Reallocating in_buf" \ |
| 2319 | -s "Reallocating out_buf" |
| 2320 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2321 | # Tests for Encrypt-then-MAC extension |
| 2322 | |
| 2323 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2324 | "$P_SRV debug_level=3 \ |
| 2325 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2326 | "$P_CLI debug_level=3" \ |
| 2327 | 0 \ |
| 2328 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2329 | -s "found encrypt then mac extension" \ |
| 2330 | -s "server hello, adding encrypt then mac extension" \ |
| 2331 | -c "found encrypt_then_mac extension" \ |
| 2332 | -c "using encrypt then mac" \ |
| 2333 | -s "using encrypt then mac" |
| 2334 | |
| 2335 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2336 | "$P_SRV debug_level=3 etm=0 \ |
| 2337 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2338 | "$P_CLI debug_level=3 etm=1" \ |
| 2339 | 0 \ |
| 2340 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2341 | -s "found encrypt then mac extension" \ |
| 2342 | -S "server hello, adding encrypt then mac extension" \ |
| 2343 | -C "found encrypt_then_mac extension" \ |
| 2344 | -C "using encrypt then mac" \ |
| 2345 | -S "using encrypt then mac" |
| 2346 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2347 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2348 | "$P_SRV debug_level=3 etm=1 \ |
| 2349 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2350 | "$P_CLI debug_level=3 etm=1" \ |
| 2351 | 0 \ |
| 2352 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2353 | -s "found encrypt then mac extension" \ |
| 2354 | -S "server hello, adding encrypt then mac extension" \ |
| 2355 | -C "found encrypt_then_mac extension" \ |
| 2356 | -C "using encrypt then mac" \ |
| 2357 | -S "using encrypt then mac" |
| 2358 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2359 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2360 | "$P_SRV debug_level=3 etm=1 \ |
| 2361 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2362 | "$P_CLI debug_level=3 etm=0" \ |
| 2363 | 0 \ |
| 2364 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2365 | -S "found encrypt then mac extension" \ |
| 2366 | -S "server hello, adding encrypt then mac extension" \ |
| 2367 | -C "found encrypt_then_mac extension" \ |
| 2368 | -C "using encrypt then mac" \ |
| 2369 | -S "using encrypt then mac" |
| 2370 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2371 | # Tests for Extended Master Secret extension |
| 2372 | |
| 2373 | run_test "Extended Master Secret: default" \ |
| 2374 | "$P_SRV debug_level=3" \ |
| 2375 | "$P_CLI debug_level=3" \ |
| 2376 | 0 \ |
| 2377 | -c "client hello, adding extended_master_secret extension" \ |
| 2378 | -s "found extended master secret extension" \ |
| 2379 | -s "server hello, adding extended master secret extension" \ |
| 2380 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2381 | -c "session hash for extended master secret" \ |
| 2382 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2383 | |
| 2384 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2385 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2386 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2387 | 0 \ |
| 2388 | -c "client hello, adding extended_master_secret extension" \ |
| 2389 | -s "found extended master secret extension" \ |
| 2390 | -S "server hello, adding extended master secret extension" \ |
| 2391 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2392 | -C "session hash for extended master secret" \ |
| 2393 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2394 | |
| 2395 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2396 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2397 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2398 | 0 \ |
| 2399 | -C "client hello, adding extended_master_secret extension" \ |
| 2400 | -S "found extended master secret extension" \ |
| 2401 | -S "server hello, adding extended master secret extension" \ |
| 2402 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2403 | -C "session hash for extended master secret" \ |
| 2404 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2405 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2406 | # Test sending and receiving empty application data records |
| 2407 | |
| 2408 | run_test "Encrypt then MAC: empty application data record" \ |
| 2409 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2410 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2411 | 0 \ |
| 2412 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2413 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2414 | -c "0 bytes written in 1 fragments" |
| 2415 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2416 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2417 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2418 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2419 | 0 \ |
| 2420 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2421 | -c "0 bytes written in 1 fragments" |
| 2422 | |
| 2423 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2424 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2425 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2426 | 0 \ |
| 2427 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2428 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2429 | -c "0 bytes written in 1 fragments" |
| 2430 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2431 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2432 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2433 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2434 | 0 \ |
| 2435 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2436 | -c "0 bytes written in 1 fragments" |
| 2437 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2438 | # Tests for CBC 1/n-1 record splitting |
| 2439 | |
| 2440 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2441 | "$P_SRV" \ |
| 2442 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2443 | request_size=123 force_version=tls1_2" \ |
| 2444 | 0 \ |
| 2445 | -s "Read from client: 123 bytes read" \ |
| 2446 | -S "Read from client: 1 bytes read" \ |
| 2447 | -S "122 bytes read" |
| 2448 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2449 | # Tests for Session Tickets |
| 2450 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2451 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2452 | "$P_SRV debug_level=3 tickets=1" \ |
| 2453 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2454 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2455 | -c "client hello, adding session ticket extension" \ |
| 2456 | -s "found session ticket extension" \ |
| 2457 | -s "server hello, adding session ticket extension" \ |
| 2458 | -c "found session_ticket extension" \ |
| 2459 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2460 | -S "session successfully restored from cache" \ |
| 2461 | -s "session successfully restored from ticket" \ |
| 2462 | -s "a session has been resumed" \ |
| 2463 | -c "a session has been resumed" |
| 2464 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2465 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2466 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2467 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2468 | 0 \ |
| 2469 | -c "client hello, adding session ticket extension" \ |
| 2470 | -s "found session ticket extension" \ |
| 2471 | -s "server hello, adding session ticket extension" \ |
| 2472 | -c "found session_ticket extension" \ |
| 2473 | -c "parse new session ticket" \ |
| 2474 | -S "session successfully restored from cache" \ |
| 2475 | -s "session successfully restored from ticket" \ |
| 2476 | -s "a session has been resumed" \ |
| 2477 | -c "a session has been resumed" |
| 2478 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2479 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2480 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2481 | "$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] | 2482 | 0 \ |
| 2483 | -c "client hello, adding session ticket extension" \ |
| 2484 | -s "found session ticket extension" \ |
| 2485 | -s "server hello, adding session ticket extension" \ |
| 2486 | -c "found session_ticket extension" \ |
| 2487 | -c "parse new session ticket" \ |
| 2488 | -S "session successfully restored from cache" \ |
| 2489 | -S "session successfully restored from ticket" \ |
| 2490 | -S "a session has been resumed" \ |
| 2491 | -C "a session has been resumed" |
| 2492 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2493 | run_test "Session resume using tickets: session copy" \ |
| 2494 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2495 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2496 | 0 \ |
| 2497 | -c "client hello, adding session ticket extension" \ |
| 2498 | -s "found session ticket extension" \ |
| 2499 | -s "server hello, adding session ticket extension" \ |
| 2500 | -c "found session_ticket extension" \ |
| 2501 | -c "parse new session ticket" \ |
| 2502 | -S "session successfully restored from cache" \ |
| 2503 | -s "session successfully restored from ticket" \ |
| 2504 | -s "a session has been resumed" \ |
| 2505 | -c "a session has been resumed" |
| 2506 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2507 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2508 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2509 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2510 | 0 \ |
| 2511 | -c "client hello, adding session ticket extension" \ |
| 2512 | -c "found session_ticket extension" \ |
| 2513 | -c "parse new session ticket" \ |
| 2514 | -c "a session has been resumed" |
| 2515 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2516 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2517 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2518 | "( $O_CLI -sess_out $SESSION; \ |
| 2519 | $O_CLI -sess_in $SESSION; \ |
| 2520 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2521 | 0 \ |
| 2522 | -s "found session ticket extension" \ |
| 2523 | -s "server hello, adding session ticket extension" \ |
| 2524 | -S "session successfully restored from cache" \ |
| 2525 | -s "session successfully restored from ticket" \ |
| 2526 | -s "a session has been resumed" |
| 2527 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2528 | # Tests for Session Tickets with DTLS |
| 2529 | |
| 2530 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2531 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2532 | "$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] | 2533 | 0 \ |
| 2534 | -c "client hello, adding session ticket extension" \ |
| 2535 | -s "found session ticket extension" \ |
| 2536 | -s "server hello, adding session ticket extension" \ |
| 2537 | -c "found session_ticket extension" \ |
| 2538 | -c "parse new session ticket" \ |
| 2539 | -S "session successfully restored from cache" \ |
| 2540 | -s "session successfully restored from ticket" \ |
| 2541 | -s "a session has been resumed" \ |
| 2542 | -c "a session has been resumed" |
| 2543 | |
| 2544 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2545 | "$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] | 2546 | "$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] | 2547 | 0 \ |
| 2548 | -c "client hello, adding session ticket extension" \ |
| 2549 | -s "found session ticket extension" \ |
| 2550 | -s "server hello, adding session ticket extension" \ |
| 2551 | -c "found session_ticket extension" \ |
| 2552 | -c "parse new session ticket" \ |
| 2553 | -S "session successfully restored from cache" \ |
| 2554 | -s "session successfully restored from ticket" \ |
| 2555 | -s "a session has been resumed" \ |
| 2556 | -c "a session has been resumed" |
| 2557 | |
| 2558 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2559 | "$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] | 2560 | "$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] | 2561 | 0 \ |
| 2562 | -c "client hello, adding session ticket extension" \ |
| 2563 | -s "found session ticket extension" \ |
| 2564 | -s "server hello, adding session ticket extension" \ |
| 2565 | -c "found session_ticket extension" \ |
| 2566 | -c "parse new session ticket" \ |
| 2567 | -S "session successfully restored from cache" \ |
| 2568 | -S "session successfully restored from ticket" \ |
| 2569 | -S "a session has been resumed" \ |
| 2570 | -C "a session has been resumed" |
| 2571 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2572 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2573 | "$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] | 2574 | "$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] | 2575 | 0 \ |
| 2576 | -c "client hello, adding session ticket extension" \ |
| 2577 | -s "found session ticket extension" \ |
| 2578 | -s "server hello, adding session ticket extension" \ |
| 2579 | -c "found session_ticket extension" \ |
| 2580 | -c "parse new session ticket" \ |
| 2581 | -S "session successfully restored from cache" \ |
| 2582 | -s "session successfully restored from ticket" \ |
| 2583 | -s "a session has been resumed" \ |
| 2584 | -c "a session has been resumed" |
| 2585 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2586 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2587 | "$O_SRV -dtls" \ |
| 2588 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2589 | 0 \ |
| 2590 | -c "client hello, adding session ticket extension" \ |
| 2591 | -c "found session_ticket extension" \ |
| 2592 | -c "parse new session ticket" \ |
| 2593 | -c "a session has been resumed" |
| 2594 | |
| 2595 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2596 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2597 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2598 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2599 | rm -f $SESSION )" \ |
| 2600 | 0 \ |
| 2601 | -s "found session ticket extension" \ |
| 2602 | -s "server hello, adding session ticket extension" \ |
| 2603 | -S "session successfully restored from cache" \ |
| 2604 | -s "session successfully restored from ticket" \ |
| 2605 | -s "a session has been resumed" |
| 2606 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2607 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2608 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2609 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2610 | "$P_SRV debug_level=3 tickets=0" \ |
| 2611 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2612 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2613 | -c "client hello, adding session ticket extension" \ |
| 2614 | -s "found session ticket extension" \ |
| 2615 | -S "server hello, adding session ticket extension" \ |
| 2616 | -C "found session_ticket extension" \ |
| 2617 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2618 | -s "session successfully restored from cache" \ |
| 2619 | -S "session successfully restored from ticket" \ |
| 2620 | -s "a session has been resumed" \ |
| 2621 | -c "a session has been resumed" |
| 2622 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2623 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2624 | "$P_SRV debug_level=3 tickets=1" \ |
| 2625 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2626 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2627 | -C "client hello, adding session ticket extension" \ |
| 2628 | -S "found session ticket extension" \ |
| 2629 | -S "server hello, adding session ticket extension" \ |
| 2630 | -C "found session_ticket extension" \ |
| 2631 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2632 | -s "session successfully restored from cache" \ |
| 2633 | -S "session successfully restored from ticket" \ |
| 2634 | -s "a session has been resumed" \ |
| 2635 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2636 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2637 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2638 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2639 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2640 | 0 \ |
| 2641 | -S "session successfully restored from cache" \ |
| 2642 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2643 | -S "a session has been resumed" \ |
| 2644 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2645 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2646 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2647 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2648 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2649 | 0 \ |
| 2650 | -s "session successfully restored from cache" \ |
| 2651 | -S "session successfully restored from ticket" \ |
| 2652 | -s "a session has been resumed" \ |
| 2653 | -c "a session has been resumed" |
| 2654 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2655 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2656 | "$P_SRV debug_level=3 tickets=0" \ |
| 2657 | "$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] | 2658 | 0 \ |
| 2659 | -s "session successfully restored from cache" \ |
| 2660 | -S "session successfully restored from ticket" \ |
| 2661 | -s "a session has been resumed" \ |
| 2662 | -c "a session has been resumed" |
| 2663 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2664 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2665 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2666 | "$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] | 2667 | 0 \ |
| 2668 | -S "session successfully restored from cache" \ |
| 2669 | -S "session successfully restored from ticket" \ |
| 2670 | -S "a session has been resumed" \ |
| 2671 | -C "a session has been resumed" |
| 2672 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2673 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2674 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2675 | "$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] | 2676 | 0 \ |
| 2677 | -s "session successfully restored from cache" \ |
| 2678 | -S "session successfully restored from ticket" \ |
| 2679 | -s "a session has been resumed" \ |
| 2680 | -c "a session has been resumed" |
| 2681 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2682 | run_test "Session resume using cache: session copy" \ |
| 2683 | "$P_SRV debug_level=3 tickets=0" \ |
| 2684 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2685 | 0 \ |
| 2686 | -s "session successfully restored from cache" \ |
| 2687 | -S "session successfully restored from ticket" \ |
| 2688 | -s "a session has been resumed" \ |
| 2689 | -c "a session has been resumed" |
| 2690 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2691 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2692 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2693 | "( $O_CLI -sess_out $SESSION; \ |
| 2694 | $O_CLI -sess_in $SESSION; \ |
| 2695 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2696 | 0 \ |
| 2697 | -s "found session ticket extension" \ |
| 2698 | -S "server hello, adding session ticket extension" \ |
| 2699 | -s "session successfully restored from cache" \ |
| 2700 | -S "session successfully restored from ticket" \ |
| 2701 | -s "a session has been resumed" |
| 2702 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2703 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2704 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2705 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2706 | 0 \ |
| 2707 | -C "found session_ticket extension" \ |
| 2708 | -C "parse new session ticket" \ |
| 2709 | -c "a session has been resumed" |
| 2710 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2711 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2712 | |
| 2713 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2714 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2715 | "$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] | 2716 | 0 \ |
| 2717 | -c "client hello, adding session ticket extension" \ |
| 2718 | -s "found session ticket extension" \ |
| 2719 | -S "server hello, adding session ticket extension" \ |
| 2720 | -C "found session_ticket extension" \ |
| 2721 | -C "parse new session ticket" \ |
| 2722 | -s "session successfully restored from cache" \ |
| 2723 | -S "session successfully restored from ticket" \ |
| 2724 | -s "a session has been resumed" \ |
| 2725 | -c "a session has been resumed" |
| 2726 | |
| 2727 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2728 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2729 | "$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] | 2730 | 0 \ |
| 2731 | -C "client hello, adding session ticket extension" \ |
| 2732 | -S "found session ticket extension" \ |
| 2733 | -S "server hello, adding session ticket extension" \ |
| 2734 | -C "found session_ticket extension" \ |
| 2735 | -C "parse new session ticket" \ |
| 2736 | -s "session successfully restored from cache" \ |
| 2737 | -S "session successfully restored from ticket" \ |
| 2738 | -s "a session has been resumed" \ |
| 2739 | -c "a session has been resumed" |
| 2740 | |
| 2741 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2742 | "$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] | 2743 | "$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] | 2744 | 0 \ |
| 2745 | -S "session successfully restored from cache" \ |
| 2746 | -S "session successfully restored from ticket" \ |
| 2747 | -S "a session has been resumed" \ |
| 2748 | -C "a session has been resumed" |
| 2749 | |
| 2750 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2751 | "$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] | 2752 | "$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] | 2753 | 0 \ |
| 2754 | -s "session successfully restored from cache" \ |
| 2755 | -S "session successfully restored from ticket" \ |
| 2756 | -s "a session has been resumed" \ |
| 2757 | -c "a session has been resumed" |
| 2758 | |
| 2759 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2760 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2761 | "$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] | 2762 | 0 \ |
| 2763 | -s "session successfully restored from cache" \ |
| 2764 | -S "session successfully restored from ticket" \ |
| 2765 | -s "a session has been resumed" \ |
| 2766 | -c "a session has been resumed" |
| 2767 | |
| 2768 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2769 | "$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] | 2770 | "$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] | 2771 | 0 \ |
| 2772 | -S "session successfully restored from cache" \ |
| 2773 | -S "session successfully restored from ticket" \ |
| 2774 | -S "a session has been resumed" \ |
| 2775 | -C "a session has been resumed" |
| 2776 | |
| 2777 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2778 | "$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] | 2779 | "$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] | 2780 | 0 \ |
| 2781 | -s "session successfully restored from cache" \ |
| 2782 | -S "session successfully restored from ticket" \ |
| 2783 | -s "a session has been resumed" \ |
| 2784 | -c "a session has been resumed" |
| 2785 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2786 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2787 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2788 | "$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] | 2789 | 0 \ |
| 2790 | -s "session successfully restored from cache" \ |
| 2791 | -S "session successfully restored from ticket" \ |
| 2792 | -s "a session has been resumed" \ |
| 2793 | -c "a session has been resumed" |
| 2794 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2795 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2796 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2797 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2798 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2799 | rm -f $SESSION )" \ |
| 2800 | 0 \ |
| 2801 | -s "found session ticket extension" \ |
| 2802 | -S "server hello, adding session ticket extension" \ |
| 2803 | -s "session successfully restored from cache" \ |
| 2804 | -S "session successfully restored from ticket" \ |
| 2805 | -s "a session has been resumed" |
| 2806 | |
| 2807 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2808 | "$O_SRV -dtls" \ |
| 2809 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2810 | 0 \ |
| 2811 | -C "found session_ticket extension" \ |
| 2812 | -C "parse new session ticket" \ |
| 2813 | -c "a session has been resumed" |
| 2814 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2815 | # Tests for Max Fragment Length extension |
| 2816 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2817 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2818 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2819 | "$P_SRV debug_level=3" \ |
| 2820 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2821 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2822 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2823 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2824 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2825 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2826 | -C "client hello, adding max_fragment_length extension" \ |
| 2827 | -S "found max fragment length extension" \ |
| 2828 | -S "server hello, max_fragment_length extension" \ |
| 2829 | -C "found max_fragment_length extension" |
| 2830 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2831 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2832 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2833 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2834 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2835 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2836 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2837 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2838 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2839 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2840 | -C "client hello, adding max_fragment_length extension" \ |
| 2841 | -S "found max fragment length extension" \ |
| 2842 | -S "server hello, max_fragment_length extension" \ |
| 2843 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2844 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2845 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2846 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2847 | |
| 2848 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2849 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2850 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2851 | "$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] | 2852 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2853 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2854 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2855 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2856 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2857 | -C "client hello, adding max_fragment_length extension" \ |
| 2858 | -S "found max fragment length extension" \ |
| 2859 | -S "server hello, max_fragment_length extension" \ |
| 2860 | -C "found max_fragment_length extension" \ |
| 2861 | -c "fragment larger than.*maximum " |
| 2862 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2863 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2864 | # (session fragment length will be 16384 regardless of mbedtls |
| 2865 | # content length configuration.) |
| 2866 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2867 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2868 | run_test "Max fragment length: disabled, larger message" \ |
| 2869 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2870 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2871 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2872 | -C "Maximum incoming record payload length is 16384" \ |
| 2873 | -C "Maximum outgoing record payload length is 16384" \ |
| 2874 | -S "Maximum incoming record payload length is 16384" \ |
| 2875 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2876 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2877 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2878 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2879 | |
| 2880 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2881 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2882 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2883 | "$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] | 2884 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2885 | -C "Maximum incoming record payload length is 16384" \ |
| 2886 | -C "Maximum outgoing record payload length is 16384" \ |
| 2887 | -S "Maximum incoming record payload length is 16384" \ |
| 2888 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2889 | -c "fragment larger than.*maximum " |
| 2890 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2891 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2892 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2893 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2894 | "$P_SRV debug_level=3" \ |
| 2895 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2896 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2897 | -c "Maximum incoming record payload length is 4096" \ |
| 2898 | -c "Maximum outgoing record payload length is 4096" \ |
| 2899 | -s "Maximum incoming record payload length is 4096" \ |
| 2900 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2901 | -c "client hello, adding max_fragment_length extension" \ |
| 2902 | -s "found max fragment length extension" \ |
| 2903 | -s "server hello, max_fragment_length extension" \ |
| 2904 | -c "found max_fragment_length extension" |
| 2905 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2906 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2907 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2908 | run_test "Max fragment length: client 512, server 1024" \ |
| 2909 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 2910 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2911 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2912 | -c "Maximum incoming record payload length is 512" \ |
| 2913 | -c "Maximum outgoing record payload length is 512" \ |
| 2914 | -s "Maximum incoming record payload length is 512" \ |
| 2915 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2916 | -c "client hello, adding max_fragment_length extension" \ |
| 2917 | -s "found max fragment length extension" \ |
| 2918 | -s "server hello, max_fragment_length extension" \ |
| 2919 | -c "found max_fragment_length extension" |
| 2920 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2921 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2922 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2923 | run_test "Max fragment length: client 512, server 2048" \ |
| 2924 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 2925 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2926 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2927 | -c "Maximum incoming record payload length is 512" \ |
| 2928 | -c "Maximum outgoing record payload length is 512" \ |
| 2929 | -s "Maximum incoming record payload length is 512" \ |
| 2930 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2931 | -c "client hello, adding max_fragment_length extension" \ |
| 2932 | -s "found max fragment length extension" \ |
| 2933 | -s "server hello, max_fragment_length extension" \ |
| 2934 | -c "found max_fragment_length extension" |
| 2935 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2936 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2937 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2938 | run_test "Max fragment length: client 512, server 4096" \ |
| 2939 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2940 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2941 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2942 | -c "Maximum incoming record payload length is 512" \ |
| 2943 | -c "Maximum outgoing record payload length is 512" \ |
| 2944 | -s "Maximum incoming record payload length is 512" \ |
| 2945 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2946 | -c "client hello, adding max_fragment_length extension" \ |
| 2947 | -s "found max fragment length extension" \ |
| 2948 | -s "server hello, max_fragment_length extension" \ |
| 2949 | -c "found max_fragment_length extension" |
| 2950 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2951 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2952 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2953 | run_test "Max fragment length: client 1024, server 512" \ |
| 2954 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 2955 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 2956 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2957 | -c "Maximum incoming record payload length is 1024" \ |
| 2958 | -c "Maximum outgoing record payload length is 1024" \ |
| 2959 | -s "Maximum incoming record payload length is 1024" \ |
| 2960 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2961 | -c "client hello, adding max_fragment_length extension" \ |
| 2962 | -s "found max fragment length extension" \ |
| 2963 | -s "server hello, max_fragment_length extension" \ |
| 2964 | -c "found max_fragment_length extension" |
| 2965 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2966 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2967 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2968 | run_test "Max fragment length: client 1024, server 2048" \ |
| 2969 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 2970 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 2971 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2972 | -c "Maximum incoming record payload length is 1024" \ |
| 2973 | -c "Maximum outgoing record payload length is 1024" \ |
| 2974 | -s "Maximum incoming record payload length is 1024" \ |
| 2975 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2976 | -c "client hello, adding max_fragment_length extension" \ |
| 2977 | -s "found max fragment length extension" \ |
| 2978 | -s "server hello, max_fragment_length extension" \ |
| 2979 | -c "found max_fragment_length extension" |
| 2980 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2981 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2982 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2983 | run_test "Max fragment length: client 1024, server 4096" \ |
| 2984 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2985 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 2986 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2987 | -c "Maximum incoming record payload length is 1024" \ |
| 2988 | -c "Maximum outgoing record payload length is 1024" \ |
| 2989 | -s "Maximum incoming record payload length is 1024" \ |
| 2990 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2991 | -c "client hello, adding max_fragment_length extension" \ |
| 2992 | -s "found max fragment length extension" \ |
| 2993 | -s "server hello, max_fragment_length extension" \ |
| 2994 | -c "found max_fragment_length extension" |
| 2995 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2996 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2997 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2998 | run_test "Max fragment length: client 2048, server 512" \ |
| 2999 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3000 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3001 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3002 | -c "Maximum incoming record payload length is 2048" \ |
| 3003 | -c "Maximum outgoing record payload length is 2048" \ |
| 3004 | -s "Maximum incoming record payload length is 2048" \ |
| 3005 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3006 | -c "client hello, adding max_fragment_length extension" \ |
| 3007 | -s "found max fragment length extension" \ |
| 3008 | -s "server hello, max_fragment_length extension" \ |
| 3009 | -c "found max_fragment_length extension" |
| 3010 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3011 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3012 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3013 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3014 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3015 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3016 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3017 | -c "Maximum incoming record payload length is 2048" \ |
| 3018 | -c "Maximum outgoing record payload length is 2048" \ |
| 3019 | -s "Maximum incoming record payload length is 2048" \ |
| 3020 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3021 | -c "client hello, adding max_fragment_length extension" \ |
| 3022 | -s "found max fragment length extension" \ |
| 3023 | -s "server hello, max_fragment_length extension" \ |
| 3024 | -c "found max_fragment_length extension" |
| 3025 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3026 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3027 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3028 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3029 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3030 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3031 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3032 | -c "Maximum incoming record payload length is 2048" \ |
| 3033 | -c "Maximum outgoing record payload length is 2048" \ |
| 3034 | -s "Maximum incoming record payload length is 2048" \ |
| 3035 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3036 | -c "client hello, adding max_fragment_length extension" \ |
| 3037 | -s "found max fragment length extension" \ |
| 3038 | -s "server hello, max_fragment_length extension" \ |
| 3039 | -c "found max_fragment_length extension" |
| 3040 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3041 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3042 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3043 | run_test "Max fragment length: client 4096, server 512" \ |
| 3044 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3045 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3046 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3047 | -c "Maximum incoming record payload length is 4096" \ |
| 3048 | -c "Maximum outgoing record payload length is 4096" \ |
| 3049 | -s "Maximum incoming record payload length is 4096" \ |
| 3050 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3051 | -c "client hello, adding max_fragment_length extension" \ |
| 3052 | -s "found max fragment length extension" \ |
| 3053 | -s "server hello, max_fragment_length extension" \ |
| 3054 | -c "found max_fragment_length extension" |
| 3055 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3056 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3057 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3058 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3059 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3060 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3061 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3062 | -c "Maximum incoming record payload length is 4096" \ |
| 3063 | -c "Maximum outgoing record payload length is 4096" \ |
| 3064 | -s "Maximum incoming record payload length is 4096" \ |
| 3065 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3066 | -c "client hello, adding max_fragment_length extension" \ |
| 3067 | -s "found max fragment length extension" \ |
| 3068 | -s "server hello, max_fragment_length extension" \ |
| 3069 | -c "found max_fragment_length extension" |
| 3070 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3071 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3072 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3073 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3074 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3075 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3076 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3077 | -c "Maximum incoming record payload length is 4096" \ |
| 3078 | -c "Maximum outgoing record payload length is 4096" \ |
| 3079 | -s "Maximum incoming record payload length is 4096" \ |
| 3080 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +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" |
| 3085 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3086 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3087 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3088 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3089 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3090 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3091 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3092 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3093 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3094 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3095 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3096 | -C "client hello, adding max_fragment_length extension" \ |
| 3097 | -S "found max fragment length extension" \ |
| 3098 | -S "server hello, max_fragment_length extension" \ |
| 3099 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3100 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3101 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3102 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3103 | requires_gnutls |
| 3104 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3105 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3106 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3107 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3108 | -c "Maximum incoming record payload length is 4096" \ |
| 3109 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3110 | -c "client hello, adding max_fragment_length extension" \ |
| 3111 | -c "found max_fragment_length extension" |
| 3112 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3113 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3114 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3115 | run_test "Max fragment length: client, message just fits" \ |
| 3116 | "$P_SRV debug_level=3" \ |
| 3117 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3118 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3119 | -c "Maximum incoming record payload length is 2048" \ |
| 3120 | -c "Maximum outgoing record payload length is 2048" \ |
| 3121 | -s "Maximum incoming record payload length is 2048" \ |
| 3122 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3123 | -c "client hello, adding max_fragment_length extension" \ |
| 3124 | -s "found max fragment length extension" \ |
| 3125 | -s "server hello, max_fragment_length extension" \ |
| 3126 | -c "found max_fragment_length extension" \ |
| 3127 | -c "2048 bytes written in 1 fragments" \ |
| 3128 | -s "2048 bytes read" |
| 3129 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3130 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3131 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3132 | run_test "Max fragment length: client, larger message" \ |
| 3133 | "$P_SRV debug_level=3" \ |
| 3134 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3135 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3136 | -c "Maximum incoming record payload length is 2048" \ |
| 3137 | -c "Maximum outgoing record payload length is 2048" \ |
| 3138 | -s "Maximum incoming record payload length is 2048" \ |
| 3139 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3140 | -c "client hello, adding max_fragment_length extension" \ |
| 3141 | -s "found max fragment length extension" \ |
| 3142 | -s "server hello, max_fragment_length extension" \ |
| 3143 | -c "found max_fragment_length extension" \ |
| 3144 | -c "2345 bytes written in 2 fragments" \ |
| 3145 | -s "2048 bytes read" \ |
| 3146 | -s "297 bytes read" |
| 3147 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3148 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3149 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3150 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3151 | "$P_SRV debug_level=3 dtls=1" \ |
| 3152 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3153 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3154 | -c "Maximum incoming record payload length is 2048" \ |
| 3155 | -c "Maximum outgoing record payload length is 2048" \ |
| 3156 | -s "Maximum incoming record payload length is 2048" \ |
| 3157 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3158 | -c "client hello, adding max_fragment_length extension" \ |
| 3159 | -s "found max fragment length extension" \ |
| 3160 | -s "server hello, max_fragment_length extension" \ |
| 3161 | -c "found max_fragment_length extension" \ |
| 3162 | -c "fragment larger than.*maximum" |
| 3163 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3164 | # Tests for renegotiation |
| 3165 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3166 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3167 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3168 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3169 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3170 | 0 \ |
| 3171 | -C "client hello, adding renegotiation extension" \ |
| 3172 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3173 | -S "found renegotiation extension" \ |
| 3174 | -s "server hello, secure renegotiation extension" \ |
| 3175 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3176 | -C "=> renegotiate" \ |
| 3177 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3178 | -S "write hello request" |
| 3179 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3180 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3181 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3182 | "$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] | 3183 | "$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] | 3184 | 0 \ |
| 3185 | -c "client hello, adding renegotiation extension" \ |
| 3186 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3187 | -s "found renegotiation extension" \ |
| 3188 | -s "server hello, secure renegotiation extension" \ |
| 3189 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3190 | -c "=> renegotiate" \ |
| 3191 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3192 | -S "write hello request" |
| 3193 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3194 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3195 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3196 | "$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] | 3197 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3198 | 0 \ |
| 3199 | -c "client hello, adding renegotiation extension" \ |
| 3200 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3201 | -s "found renegotiation extension" \ |
| 3202 | -s "server hello, secure renegotiation extension" \ |
| 3203 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3204 | -c "=> renegotiate" \ |
| 3205 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3206 | -s "write hello request" |
| 3207 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3208 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3209 | # 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] | 3210 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3211 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3212 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3213 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3214 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3215 | 0 \ |
| 3216 | -c "client hello, adding renegotiation extension" \ |
| 3217 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3218 | -s "found renegotiation extension" \ |
| 3219 | -s "server hello, secure renegotiation extension" \ |
| 3220 | -c "found renegotiation extension" \ |
| 3221 | -c "=> renegotiate" \ |
| 3222 | -s "=> renegotiate" \ |
| 3223 | -S "write hello request" \ |
| 3224 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3225 | |
| 3226 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3227 | # 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] | 3228 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3229 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3230 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3231 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3232 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3233 | 0 \ |
| 3234 | -c "client hello, adding renegotiation extension" \ |
| 3235 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3236 | -s "found renegotiation extension" \ |
| 3237 | -s "server hello, secure renegotiation extension" \ |
| 3238 | -c "found renegotiation extension" \ |
| 3239 | -c "=> renegotiate" \ |
| 3240 | -s "=> renegotiate" \ |
| 3241 | -s "write hello request" \ |
| 3242 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3243 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3244 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3245 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3246 | "$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] | 3247 | "$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] | 3248 | 0 \ |
| 3249 | -c "client hello, adding renegotiation extension" \ |
| 3250 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3251 | -s "found renegotiation extension" \ |
| 3252 | -s "server hello, secure renegotiation extension" \ |
| 3253 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3254 | -c "=> renegotiate" \ |
| 3255 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3256 | -s "write hello request" |
| 3257 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3258 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3259 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3260 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3261 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3262 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3263 | "$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" \ |
| 3264 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3265 | -c "Maximum incoming record payload length is 2048" \ |
| 3266 | -c "Maximum outgoing record payload length is 2048" \ |
| 3267 | -s "Maximum incoming record payload length is 2048" \ |
| 3268 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3269 | -c "client hello, adding max_fragment_length extension" \ |
| 3270 | -s "found max fragment length extension" \ |
| 3271 | -s "server hello, max_fragment_length extension" \ |
| 3272 | -c "found max_fragment_length extension" \ |
| 3273 | -c "client hello, adding renegotiation extension" \ |
| 3274 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3275 | -s "found renegotiation extension" \ |
| 3276 | -s "server hello, secure renegotiation extension" \ |
| 3277 | -c "found renegotiation extension" \ |
| 3278 | -c "=> renegotiate" \ |
| 3279 | -s "=> renegotiate" \ |
| 3280 | -s "write hello request" |
| 3281 | |
| 3282 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3283 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3284 | "$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] | 3285 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3286 | 1 \ |
| 3287 | -c "client hello, adding renegotiation extension" \ |
| 3288 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3289 | -S "found renegotiation extension" \ |
| 3290 | -s "server hello, secure renegotiation extension" \ |
| 3291 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3292 | -c "=> renegotiate" \ |
| 3293 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3294 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3295 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3296 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3297 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3298 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3299 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3300 | "$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] | 3301 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3302 | 0 \ |
| 3303 | -C "client hello, adding renegotiation extension" \ |
| 3304 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3305 | -S "found renegotiation extension" \ |
| 3306 | -s "server hello, secure renegotiation extension" \ |
| 3307 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3308 | -C "=> renegotiate" \ |
| 3309 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3310 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3311 | -S "SSL - An unexpected message was received from our peer" \ |
| 3312 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3313 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3314 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3315 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3316 | "$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] | 3317 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3318 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3319 | 0 \ |
| 3320 | -C "client hello, adding renegotiation extension" \ |
| 3321 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3322 | -S "found renegotiation extension" \ |
| 3323 | -s "server hello, secure renegotiation extension" \ |
| 3324 | -c "found renegotiation extension" \ |
| 3325 | -C "=> renegotiate" \ |
| 3326 | -S "=> renegotiate" \ |
| 3327 | -s "write hello request" \ |
| 3328 | -S "SSL - An unexpected message was received from our peer" \ |
| 3329 | -S "failed" |
| 3330 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3331 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3332 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3333 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3334 | "$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] | 3335 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3336 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3337 | 0 \ |
| 3338 | -C "client hello, adding renegotiation extension" \ |
| 3339 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3340 | -S "found renegotiation extension" \ |
| 3341 | -s "server hello, secure renegotiation extension" \ |
| 3342 | -c "found renegotiation extension" \ |
| 3343 | -C "=> renegotiate" \ |
| 3344 | -S "=> renegotiate" \ |
| 3345 | -s "write hello request" \ |
| 3346 | -S "SSL - An unexpected message was received from our peer" \ |
| 3347 | -S "failed" |
| 3348 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3349 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3350 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3351 | "$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] | 3352 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3353 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3354 | 0 \ |
| 3355 | -C "client hello, adding renegotiation extension" \ |
| 3356 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3357 | -S "found renegotiation extension" \ |
| 3358 | -s "server hello, secure renegotiation extension" \ |
| 3359 | -c "found renegotiation extension" \ |
| 3360 | -C "=> renegotiate" \ |
| 3361 | -S "=> renegotiate" \ |
| 3362 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3363 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3364 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3365 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3366 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3367 | "$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] | 3368 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3369 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3370 | 0 \ |
| 3371 | -c "client hello, adding renegotiation extension" \ |
| 3372 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3373 | -s "found renegotiation extension" \ |
| 3374 | -s "server hello, secure renegotiation extension" \ |
| 3375 | -c "found renegotiation extension" \ |
| 3376 | -c "=> renegotiate" \ |
| 3377 | -s "=> renegotiate" \ |
| 3378 | -s "write hello request" \ |
| 3379 | -S "SSL - An unexpected message was received from our peer" \ |
| 3380 | -S "failed" |
| 3381 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3382 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3383 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3384 | "$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] | 3385 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3386 | 0 \ |
| 3387 | -C "client hello, adding renegotiation extension" \ |
| 3388 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3389 | -S "found renegotiation extension" \ |
| 3390 | -s "server hello, secure renegotiation extension" \ |
| 3391 | -c "found renegotiation extension" \ |
| 3392 | -S "record counter limit reached: renegotiate" \ |
| 3393 | -C "=> renegotiate" \ |
| 3394 | -S "=> renegotiate" \ |
| 3395 | -S "write hello request" \ |
| 3396 | -S "SSL - An unexpected message was received from our peer" \ |
| 3397 | -S "failed" |
| 3398 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3399 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3400 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3401 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3402 | "$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] | 3403 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3404 | 0 \ |
| 3405 | -c "client hello, adding renegotiation extension" \ |
| 3406 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3407 | -s "found renegotiation extension" \ |
| 3408 | -s "server hello, secure renegotiation extension" \ |
| 3409 | -c "found renegotiation extension" \ |
| 3410 | -s "record counter limit reached: renegotiate" \ |
| 3411 | -c "=> renegotiate" \ |
| 3412 | -s "=> renegotiate" \ |
| 3413 | -s "write hello request" \ |
| 3414 | -S "SSL - An unexpected message was received from our peer" \ |
| 3415 | -S "failed" |
| 3416 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3417 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3418 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3419 | "$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] | 3420 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3421 | 0 \ |
| 3422 | -c "client hello, adding renegotiation extension" \ |
| 3423 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3424 | -s "found renegotiation extension" \ |
| 3425 | -s "server hello, secure renegotiation extension" \ |
| 3426 | -c "found renegotiation extension" \ |
| 3427 | -s "record counter limit reached: renegotiate" \ |
| 3428 | -c "=> renegotiate" \ |
| 3429 | -s "=> renegotiate" \ |
| 3430 | -s "write hello request" \ |
| 3431 | -S "SSL - An unexpected message was received from our peer" \ |
| 3432 | -S "failed" |
| 3433 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3434 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3435 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3436 | "$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] | 3437 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3438 | 0 \ |
| 3439 | -C "client hello, adding renegotiation extension" \ |
| 3440 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3441 | -S "found renegotiation extension" \ |
| 3442 | -s "server hello, secure renegotiation extension" \ |
| 3443 | -c "found renegotiation extension" \ |
| 3444 | -S "record counter limit reached: renegotiate" \ |
| 3445 | -C "=> renegotiate" \ |
| 3446 | -S "=> renegotiate" \ |
| 3447 | -S "write hello request" \ |
| 3448 | -S "SSL - An unexpected message was received from our peer" \ |
| 3449 | -S "failed" |
| 3450 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3451 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3452 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3453 | "$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] | 3454 | "$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] | 3455 | 0 \ |
| 3456 | -c "client hello, adding renegotiation extension" \ |
| 3457 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3458 | -s "found renegotiation extension" \ |
| 3459 | -s "server hello, secure renegotiation extension" \ |
| 3460 | -c "found renegotiation extension" \ |
| 3461 | -c "=> renegotiate" \ |
| 3462 | -s "=> renegotiate" \ |
| 3463 | -S "write hello request" |
| 3464 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3465 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3466 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3467 | "$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] | 3468 | "$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] | 3469 | 0 \ |
| 3470 | -c "client hello, adding renegotiation extension" \ |
| 3471 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3472 | -s "found renegotiation extension" \ |
| 3473 | -s "server hello, secure renegotiation extension" \ |
| 3474 | -c "found renegotiation extension" \ |
| 3475 | -c "=> renegotiate" \ |
| 3476 | -s "=> renegotiate" \ |
| 3477 | -s "write hello request" |
| 3478 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3479 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3480 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3481 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3482 | "$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] | 3483 | 0 \ |
| 3484 | -c "client hello, adding renegotiation extension" \ |
| 3485 | -c "found renegotiation extension" \ |
| 3486 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3487 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3488 | -C "error" \ |
| 3489 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3490 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3491 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3492 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3493 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3494 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3495 | "$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] | 3496 | 0 \ |
| 3497 | -c "client hello, adding renegotiation extension" \ |
| 3498 | -c "found renegotiation extension" \ |
| 3499 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3500 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3501 | -C "error" \ |
| 3502 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3503 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3504 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3505 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3506 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3507 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3508 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3509 | 1 \ |
| 3510 | -c "client hello, adding renegotiation extension" \ |
| 3511 | -C "found renegotiation extension" \ |
| 3512 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3513 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3514 | -c "error" \ |
| 3515 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3516 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3517 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3518 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3519 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3520 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3521 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3522 | allow_legacy=0" \ |
| 3523 | 1 \ |
| 3524 | -c "client hello, adding renegotiation extension" \ |
| 3525 | -C "found renegotiation extension" \ |
| 3526 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3527 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3528 | -c "error" \ |
| 3529 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3530 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3531 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3532 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3533 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3534 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3535 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3536 | allow_legacy=1" \ |
| 3537 | 0 \ |
| 3538 | -c "client hello, adding renegotiation extension" \ |
| 3539 | -C "found renegotiation extension" \ |
| 3540 | -c "=> renegotiate" \ |
| 3541 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3542 | -C "error" \ |
| 3543 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3544 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3545 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3546 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3547 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3548 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3549 | 0 \ |
| 3550 | -c "client hello, adding renegotiation extension" \ |
| 3551 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3552 | -s "found renegotiation extension" \ |
| 3553 | -s "server hello, secure renegotiation extension" \ |
| 3554 | -c "found renegotiation extension" \ |
| 3555 | -c "=> renegotiate" \ |
| 3556 | -s "=> renegotiate" \ |
| 3557 | -S "write hello request" |
| 3558 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3559 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3560 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3561 | "$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] | 3562 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3563 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3564 | 0 \ |
| 3565 | -c "client hello, adding renegotiation extension" \ |
| 3566 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3567 | -s "found renegotiation extension" \ |
| 3568 | -s "server hello, secure renegotiation extension" \ |
| 3569 | -c "found renegotiation extension" \ |
| 3570 | -c "=> renegotiate" \ |
| 3571 | -s "=> renegotiate" \ |
| 3572 | -s "write hello request" |
| 3573 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3574 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3575 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3576 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3577 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 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 | -s "record counter limit reached: renegotiate" \ |
| 3584 | -c "=> renegotiate" \ |
| 3585 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3586 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3587 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3588 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3589 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3590 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3591 | "$G_SRV -u --mtu 4096" \ |
| 3592 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3593 | 0 \ |
| 3594 | -c "client hello, adding renegotiation extension" \ |
| 3595 | -c "found renegotiation extension" \ |
| 3596 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3597 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3598 | -C "error" \ |
| 3599 | -s "Extra-header:" |
| 3600 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3601 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3602 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3603 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3604 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3605 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3606 | "$P_CLI debug_level=3" \ |
| 3607 | 0 \ |
| 3608 | -c "found renegotiation extension" \ |
| 3609 | -C "error" \ |
| 3610 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3611 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3612 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3613 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3614 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3615 | "$P_CLI debug_level=3" \ |
| 3616 | 0 \ |
| 3617 | -C "found renegotiation extension" \ |
| 3618 | -C "error" \ |
| 3619 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3620 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3621 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3622 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3623 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3624 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3625 | 1 \ |
| 3626 | -C "found renegotiation extension" \ |
| 3627 | -c "error" \ |
| 3628 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3629 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3630 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3631 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3632 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3633 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3634 | 0 \ |
| 3635 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3636 | -s "server hello, secure renegotiation extension" |
| 3637 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3638 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3639 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3640 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3641 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3642 | 0 \ |
| 3643 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3644 | -S "server hello, secure renegotiation extension" |
| 3645 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3646 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3647 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3648 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3649 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3650 | 1 \ |
| 3651 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3652 | -S "server hello, secure renegotiation extension" |
| 3653 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3654 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3655 | |
| 3656 | requires_gnutls |
| 3657 | run_test "DER format: no trailing bytes" \ |
| 3658 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3659 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3660 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3661 | 0 \ |
| 3662 | -c "Handshake was completed" \ |
| 3663 | |
| 3664 | requires_gnutls |
| 3665 | run_test "DER format: with a trailing zero byte" \ |
| 3666 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3667 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3668 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3669 | 0 \ |
| 3670 | -c "Handshake was completed" \ |
| 3671 | |
| 3672 | requires_gnutls |
| 3673 | run_test "DER format: with a trailing random byte" \ |
| 3674 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3675 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3676 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3677 | 0 \ |
| 3678 | -c "Handshake was completed" \ |
| 3679 | |
| 3680 | requires_gnutls |
| 3681 | run_test "DER format: with 2 trailing random bytes" \ |
| 3682 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3683 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3684 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3685 | 0 \ |
| 3686 | -c "Handshake was completed" \ |
| 3687 | |
| 3688 | requires_gnutls |
| 3689 | run_test "DER format: with 4 trailing random bytes" \ |
| 3690 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3691 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3692 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3693 | 0 \ |
| 3694 | -c "Handshake was completed" \ |
| 3695 | |
| 3696 | requires_gnutls |
| 3697 | run_test "DER format: with 8 trailing random bytes" \ |
| 3698 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3699 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3700 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3701 | 0 \ |
| 3702 | -c "Handshake was completed" \ |
| 3703 | |
| 3704 | requires_gnutls |
| 3705 | run_test "DER format: with 9 trailing random bytes" \ |
| 3706 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3707 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3708 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3709 | 0 \ |
| 3710 | -c "Handshake was completed" \ |
| 3711 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3712 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3713 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3714 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3715 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3716 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3717 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3718 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3719 | 1 \ |
| 3720 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3721 | -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] | 3722 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3723 | -c "X509 - Certificate verification failed" |
| 3724 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3725 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3726 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3727 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3728 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3729 | 0 \ |
| 3730 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3731 | -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] | 3732 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3733 | -C "X509 - Certificate verification failed" |
| 3734 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3735 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3736 | "$P_SRV" \ |
| 3737 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3738 | 0 \ |
| 3739 | -c "x509_verify_cert() returned" \ |
| 3740 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3741 | -c "! Certificate verification flags"\ |
| 3742 | -C "! mbedtls_ssl_handshake returned" \ |
| 3743 | -C "X509 - Certificate verification failed" \ |
| 3744 | -C "SSL - No CA Chain is set, but required to operate" |
| 3745 | |
| 3746 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3747 | "$P_SRV" \ |
| 3748 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3749 | 1 \ |
| 3750 | -c "x509_verify_cert() returned" \ |
| 3751 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3752 | -c "! Certificate verification flags"\ |
| 3753 | -c "! mbedtls_ssl_handshake returned" \ |
| 3754 | -c "SSL - No CA Chain is set, but required to operate" |
| 3755 | |
| 3756 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3757 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3758 | # the client informs the server about the supported curves - it does, though, in the |
| 3759 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3760 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3761 | # different means to have the server ignoring the client's supported curve list. |
| 3762 | |
| 3763 | requires_config_enabled MBEDTLS_ECP_C |
| 3764 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3765 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3766 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3767 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3768 | 1 \ |
| 3769 | -c "bad certificate (EC key curve)"\ |
| 3770 | -c "! Certificate verification flags"\ |
| 3771 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3772 | |
| 3773 | requires_config_enabled MBEDTLS_ECP_C |
| 3774 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3775 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3776 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3777 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3778 | 1 \ |
| 3779 | -c "bad certificate (EC key curve)"\ |
| 3780 | -c "! Certificate verification flags"\ |
| 3781 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3782 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3783 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3784 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3785 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3786 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3787 | 0 \ |
| 3788 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3789 | -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] | 3790 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3791 | -C "X509 - Certificate verification failed" |
| 3792 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3793 | run_test "Authentication: client SHA256, server required" \ |
| 3794 | "$P_SRV auth_mode=required" \ |
| 3795 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3796 | key_file=data_files/server6.key \ |
| 3797 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3798 | 0 \ |
| 3799 | -c "Supported Signature Algorithm found: 4," \ |
| 3800 | -c "Supported Signature Algorithm found: 5," |
| 3801 | |
| 3802 | run_test "Authentication: client SHA384, server required" \ |
| 3803 | "$P_SRV auth_mode=required" \ |
| 3804 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3805 | key_file=data_files/server6.key \ |
| 3806 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3807 | 0 \ |
| 3808 | -c "Supported Signature Algorithm found: 4," \ |
| 3809 | -c "Supported Signature Algorithm found: 5," |
| 3810 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3811 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3812 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3813 | "$P_CLI debug_level=3 crt_file=none \ |
| 3814 | key_file=data_files/server5.key" \ |
| 3815 | 1 \ |
| 3816 | -S "skip write certificate request" \ |
| 3817 | -C "skip parse certificate request" \ |
| 3818 | -c "got a certificate request" \ |
| 3819 | -c "= write certificate$" \ |
| 3820 | -C "skip write certificate$" \ |
| 3821 | -S "x509_verify_cert() returned" \ |
| 3822 | -s "client has no certificate" \ |
| 3823 | -s "! mbedtls_ssl_handshake returned" \ |
| 3824 | -c "! mbedtls_ssl_handshake returned" \ |
| 3825 | -s "No client certification received from the client, but required by the authentication mode" |
| 3826 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3827 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3828 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3829 | "$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] | 3830 | key_file=data_files/server5.key" \ |
| 3831 | 1 \ |
| 3832 | -S "skip write certificate request" \ |
| 3833 | -C "skip parse certificate request" \ |
| 3834 | -c "got a certificate request" \ |
| 3835 | -C "skip write certificate" \ |
| 3836 | -C "skip write certificate verify" \ |
| 3837 | -S "skip parse certificate verify" \ |
| 3838 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3839 | -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] | 3840 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3841 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3842 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3843 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3844 | # We don't check that the client receives the alert because it might |
| 3845 | # detect that its write end of the connection is closed and abort |
| 3846 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3847 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3848 | run_test "Authentication: client cert not trusted, server required" \ |
| 3849 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3850 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3851 | key_file=data_files/server5.key" \ |
| 3852 | 1 \ |
| 3853 | -S "skip write certificate request" \ |
| 3854 | -C "skip parse certificate request" \ |
| 3855 | -c "got a certificate request" \ |
| 3856 | -C "skip write certificate" \ |
| 3857 | -C "skip write certificate verify" \ |
| 3858 | -S "skip parse certificate verify" \ |
| 3859 | -s "x509_verify_cert() returned" \ |
| 3860 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3861 | -s "! mbedtls_ssl_handshake returned" \ |
| 3862 | -c "! mbedtls_ssl_handshake returned" \ |
| 3863 | -s "X509 - Certificate verification failed" |
| 3864 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3865 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3866 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3867 | "$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] | 3868 | key_file=data_files/server5.key" \ |
| 3869 | 0 \ |
| 3870 | -S "skip write certificate request" \ |
| 3871 | -C "skip parse certificate request" \ |
| 3872 | -c "got a certificate request" \ |
| 3873 | -C "skip write certificate" \ |
| 3874 | -C "skip write certificate verify" \ |
| 3875 | -S "skip parse certificate verify" \ |
| 3876 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3877 | -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] | 3878 | -S "! mbedtls_ssl_handshake returned" \ |
| 3879 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3880 | -S "X509 - Certificate verification failed" |
| 3881 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3882 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3883 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3884 | "$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] | 3885 | key_file=data_files/server5.key" \ |
| 3886 | 0 \ |
| 3887 | -s "skip write certificate request" \ |
| 3888 | -C "skip parse certificate request" \ |
| 3889 | -c "got no certificate request" \ |
| 3890 | -c "skip write certificate" \ |
| 3891 | -c "skip write certificate verify" \ |
| 3892 | -s "skip parse certificate verify" \ |
| 3893 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3894 | -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] | 3895 | -S "! mbedtls_ssl_handshake returned" \ |
| 3896 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3897 | -S "X509 - Certificate verification failed" |
| 3898 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3899 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3900 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3901 | "$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] | 3902 | 0 \ |
| 3903 | -S "skip write certificate request" \ |
| 3904 | -C "skip parse certificate request" \ |
| 3905 | -c "got a certificate request" \ |
| 3906 | -C "skip write certificate$" \ |
| 3907 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3908 | -c "skip write certificate verify" \ |
| 3909 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3910 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3911 | -S "! mbedtls_ssl_handshake returned" \ |
| 3912 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3913 | -S "X509 - Certificate verification failed" |
| 3914 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3915 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3916 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3917 | "$O_CLI" \ |
| 3918 | 0 \ |
| 3919 | -S "skip write certificate request" \ |
| 3920 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3921 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3922 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3923 | -S "X509 - Certificate verification failed" |
| 3924 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3925 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3926 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3927 | "$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] | 3928 | 0 \ |
| 3929 | -C "skip parse certificate request" \ |
| 3930 | -c "got a certificate request" \ |
| 3931 | -C "skip write certificate$" \ |
| 3932 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3933 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3934 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3935 | run_test "Authentication: client no cert, openssl server required" \ |
| 3936 | "$O_SRV -Verify 10" \ |
| 3937 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 3938 | 1 \ |
| 3939 | -C "skip parse certificate request" \ |
| 3940 | -c "got a certificate request" \ |
| 3941 | -C "skip write certificate$" \ |
| 3942 | -c "skip write certificate verify" \ |
| 3943 | -c "! mbedtls_ssl_handshake returned" |
| 3944 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 3945 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 3946 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 3947 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3948 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3949 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3950 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 3951 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 3952 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 3953 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 3954 | # 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] | 3955 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3956 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3957 | run_test "Authentication: server max_int chain, client default" \ |
| 3958 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3959 | key_file=data_files/dir-maxpath/09.key" \ |
| 3960 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3961 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3962 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3963 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3964 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3965 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3966 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 3967 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3968 | key_file=data_files/dir-maxpath/10.key" \ |
| 3969 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3970 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3971 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3972 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3973 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3974 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3975 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 3976 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3977 | key_file=data_files/dir-maxpath/10.key" \ |
| 3978 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3979 | auth_mode=optional" \ |
| 3980 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3981 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3982 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3983 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3984 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3985 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 3986 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3987 | key_file=data_files/dir-maxpath/10.key" \ |
| 3988 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3989 | auth_mode=none" \ |
| 3990 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3991 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3992 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3993 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3994 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3995 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 3996 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 3997 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3998 | key_file=data_files/dir-maxpath/10.key" \ |
| 3999 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4000 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4001 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4002 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4003 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4004 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4005 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4006 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4007 | key_file=data_files/dir-maxpath/10.key" \ |
| 4008 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4009 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4010 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4011 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4012 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4013 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4014 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4015 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4016 | key_file=data_files/dir-maxpath/10.key" \ |
| 4017 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4018 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4019 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4020 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4021 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4022 | run_test "Authentication: client max_int chain, server required" \ |
| 4023 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4024 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4025 | key_file=data_files/dir-maxpath/09.key" \ |
| 4026 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4027 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4028 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4029 | # Tests for CA list in CertificateRequest messages |
| 4030 | |
| 4031 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4032 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4033 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4034 | key_file=data_files/server6.key" \ |
| 4035 | 0 \ |
| 4036 | -s "requested DN" |
| 4037 | |
| 4038 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4039 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4040 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4041 | key_file=data_files/server6.key" \ |
| 4042 | 0 \ |
| 4043 | -S "requested DN" |
| 4044 | |
| 4045 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4046 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4047 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4048 | key_file=data_files/server5.key" \ |
| 4049 | 1 \ |
| 4050 | -S "requested DN" \ |
| 4051 | -s "x509_verify_cert() returned" \ |
| 4052 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4053 | -s "! mbedtls_ssl_handshake returned" \ |
| 4054 | -c "! mbedtls_ssl_handshake returned" \ |
| 4055 | -s "X509 - Certificate verification failed" |
| 4056 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4057 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4058 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4059 | |
| 4060 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4061 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4062 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4063 | key_file=data_files/server5.key" \ |
| 4064 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4065 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4066 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4067 | -c "x509_verify_cert() returned" \ |
| 4068 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4069 | -c "! mbedtls_ssl_handshake returned" \ |
| 4070 | -c "X509 - Certificate verification failed" |
| 4071 | |
| 4072 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4073 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4074 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4075 | key_file=data_files/server5.key" \ |
| 4076 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4077 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4078 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4079 | -c "x509_verify_cert() returned" \ |
| 4080 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4081 | -C "! mbedtls_ssl_handshake returned" \ |
| 4082 | -C "X509 - Certificate verification failed" |
| 4083 | |
| 4084 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4085 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4086 | # the client informs the server about the supported curves - it does, though, in the |
| 4087 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4088 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4089 | # different means to have the server ignoring the client's supported curve list. |
| 4090 | |
| 4091 | requires_config_enabled MBEDTLS_ECP_C |
| 4092 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4093 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4094 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4095 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4096 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4097 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4098 | -c "use CA callback for X.509 CRT verification" \ |
| 4099 | -c "bad certificate (EC key curve)" \ |
| 4100 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4101 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4102 | |
| 4103 | requires_config_enabled MBEDTLS_ECP_C |
| 4104 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4105 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4106 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4107 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4108 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4109 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4110 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4111 | -c "bad certificate (EC key curve)"\ |
| 4112 | -c "! Certificate verification flags"\ |
| 4113 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4114 | |
| 4115 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4116 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4117 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4118 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4119 | key_file=data_files/server6.key \ |
| 4120 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4121 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4122 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4123 | -c "Supported Signature Algorithm found: 4," \ |
| 4124 | -c "Supported Signature Algorithm found: 5," |
| 4125 | |
| 4126 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4127 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4128 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4129 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4130 | key_file=data_files/server6.key \ |
| 4131 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4132 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4133 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4134 | -c "Supported Signature Algorithm found: 4," \ |
| 4135 | -c "Supported Signature Algorithm found: 5," |
| 4136 | |
| 4137 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4138 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4139 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4140 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4141 | key_file=data_files/server5.key" \ |
| 4142 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4143 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 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 "skip write certificate verify" \ |
| 4149 | -S "skip parse certificate verify" \ |
| 4150 | -s "x509_verify_cert() returned" \ |
| 4151 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4152 | -s "! mbedtls_ssl_handshake returned" \ |
| 4153 | -s "send alert level=2 message=48" \ |
| 4154 | -c "! mbedtls_ssl_handshake returned" \ |
| 4155 | -s "X509 - Certificate verification failed" |
| 4156 | # We don't check that the client receives the alert because it might |
| 4157 | # detect that its write end of the connection is closed and abort |
| 4158 | # before reading the alert message. |
| 4159 | |
| 4160 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4161 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4162 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4163 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4164 | key_file=data_files/server5.key" \ |
| 4165 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4166 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4167 | -S "skip write certificate request" \ |
| 4168 | -C "skip parse certificate request" \ |
| 4169 | -c "got a certificate request" \ |
| 4170 | -C "skip write certificate" \ |
| 4171 | -C "skip write certificate verify" \ |
| 4172 | -S "skip parse certificate verify" \ |
| 4173 | -s "x509_verify_cert() returned" \ |
| 4174 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4175 | -s "! mbedtls_ssl_handshake returned" \ |
| 4176 | -c "! mbedtls_ssl_handshake returned" \ |
| 4177 | -s "X509 - Certificate verification failed" |
| 4178 | |
| 4179 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4180 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4181 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4182 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4183 | key_file=data_files/server5.key" \ |
| 4184 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4185 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4186 | -S "skip write certificate request" \ |
| 4187 | -C "skip parse certificate request" \ |
| 4188 | -c "got a certificate request" \ |
| 4189 | -C "skip write certificate" \ |
| 4190 | -C "skip write certificate verify" \ |
| 4191 | -S "skip parse certificate verify" \ |
| 4192 | -s "x509_verify_cert() returned" \ |
| 4193 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4194 | -S "! mbedtls_ssl_handshake returned" \ |
| 4195 | -C "! mbedtls_ssl_handshake returned" \ |
| 4196 | -S "X509 - Certificate verification failed" |
| 4197 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4198 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4199 | requires_full_size_output_buffer |
| 4200 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4201 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4202 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4203 | key_file=data_files/dir-maxpath/09.key" \ |
| 4204 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4205 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4206 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4207 | -C "X509 - A fatal error occurred" |
| 4208 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4209 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4210 | requires_full_size_output_buffer |
| 4211 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4212 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4213 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4214 | key_file=data_files/dir-maxpath/10.key" \ |
| 4215 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4216 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4217 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4218 | -c "X509 - A fatal error occurred" |
| 4219 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4220 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4221 | requires_full_size_output_buffer |
| 4222 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4223 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4224 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4225 | key_file=data_files/dir-maxpath/10.key" \ |
| 4226 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4227 | debug_level=3 auth_mode=optional" \ |
| 4228 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4229 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4230 | -c "X509 - A fatal error occurred" |
| 4231 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4232 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4233 | requires_full_size_output_buffer |
| 4234 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4235 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4236 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4237 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4238 | key_file=data_files/dir-maxpath/10.key" \ |
| 4239 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4240 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4241 | -s "X509 - A fatal error occurred" |
| 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 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4244 | requires_full_size_output_buffer |
| 4245 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4246 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4247 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4248 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4249 | key_file=data_files/dir-maxpath/10.key" \ |
| 4250 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4251 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4252 | -s "X509 - A fatal error occurred" |
| 4253 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4254 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4255 | requires_full_size_output_buffer |
| 4256 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4257 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4258 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4259 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4260 | key_file=data_files/dir-maxpath/09.key" \ |
| 4261 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4262 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4263 | -S "X509 - A fatal error occurred" |
| 4264 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4265 | # Tests for certificate selection based on SHA verson |
| 4266 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4267 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4268 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4269 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4270 | key_file=data_files/server5.key \ |
| 4271 | crt_file2=data_files/server5-sha1.crt \ |
| 4272 | key_file2=data_files/server5.key" \ |
| 4273 | "$P_CLI force_version=tls1_2" \ |
| 4274 | 0 \ |
| 4275 | -c "signed using.*ECDSA with SHA256" \ |
| 4276 | -C "signed using.*ECDSA with SHA1" |
| 4277 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4278 | # tests for SNI |
| 4279 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4280 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4281 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4282 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4283 | 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] | 4284 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4285 | 0 \ |
| 4286 | -S "parse ServerName extension" \ |
| 4287 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4288 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4289 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4290 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4291 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4292 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4293 | 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] | 4294 | 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] | 4295 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4296 | 0 \ |
| 4297 | -s "parse ServerName extension" \ |
| 4298 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4299 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4300 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4301 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4302 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4303 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4304 | 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] | 4305 | 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] | 4306 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4307 | 0 \ |
| 4308 | -s "parse ServerName extension" \ |
| 4309 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4310 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4311 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4312 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4313 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4314 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4315 | 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] | 4316 | 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] | 4317 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4318 | 1 \ |
| 4319 | -s "parse ServerName extension" \ |
| 4320 | -s "ssl_sni_wrapper() returned" \ |
| 4321 | -s "mbedtls_ssl_handshake returned" \ |
| 4322 | -c "mbedtls_ssl_handshake returned" \ |
| 4323 | -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] | 4324 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4325 | run_test "SNI: client auth no override: optional" \ |
| 4326 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4327 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4328 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4329 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4330 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4331 | -S "skip write certificate request" \ |
| 4332 | -C "skip parse certificate request" \ |
| 4333 | -c "got a certificate request" \ |
| 4334 | -C "skip write certificate" \ |
| 4335 | -C "skip write certificate verify" \ |
| 4336 | -S "skip parse certificate verify" |
| 4337 | |
| 4338 | run_test "SNI: client auth override: none -> optional" \ |
| 4339 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4340 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4341 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4342 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4343 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4344 | -S "skip write certificate request" \ |
| 4345 | -C "skip parse certificate request" \ |
| 4346 | -c "got a certificate request" \ |
| 4347 | -C "skip write certificate" \ |
| 4348 | -C "skip write certificate verify" \ |
| 4349 | -S "skip parse certificate verify" |
| 4350 | |
| 4351 | run_test "SNI: client auth override: optional -> none" \ |
| 4352 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4353 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4354 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4355 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4356 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4357 | -s "skip write certificate request" \ |
| 4358 | -C "skip parse certificate request" \ |
| 4359 | -c "got no certificate request" \ |
| 4360 | -c "skip write certificate" \ |
| 4361 | -c "skip write certificate verify" \ |
| 4362 | -s "skip parse certificate verify" |
| 4363 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4364 | run_test "SNI: CA no override" \ |
| 4365 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4366 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4367 | ca_file=data_files/test-ca.crt \ |
| 4368 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4369 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4370 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4371 | 1 \ |
| 4372 | -S "skip write certificate request" \ |
| 4373 | -C "skip parse certificate request" \ |
| 4374 | -c "got a certificate request" \ |
| 4375 | -C "skip write certificate" \ |
| 4376 | -C "skip write certificate verify" \ |
| 4377 | -S "skip parse certificate verify" \ |
| 4378 | -s "x509_verify_cert() returned" \ |
| 4379 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4380 | -S "The certificate has been revoked (is on a CRL)" |
| 4381 | |
| 4382 | run_test "SNI: CA override" \ |
| 4383 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4384 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4385 | ca_file=data_files/test-ca.crt \ |
| 4386 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4387 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4388 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4389 | 0 \ |
| 4390 | -S "skip write certificate request" \ |
| 4391 | -C "skip parse certificate request" \ |
| 4392 | -c "got a certificate request" \ |
| 4393 | -C "skip write certificate" \ |
| 4394 | -C "skip write certificate verify" \ |
| 4395 | -S "skip parse certificate verify" \ |
| 4396 | -S "x509_verify_cert() returned" \ |
| 4397 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4398 | -S "The certificate has been revoked (is on a CRL)" |
| 4399 | |
| 4400 | run_test "SNI: CA override with CRL" \ |
| 4401 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4402 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4403 | ca_file=data_files/test-ca.crt \ |
| 4404 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4405 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4406 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4407 | 1 \ |
| 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 "The certificate has been revoked (is on a CRL)" |
| 4417 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4418 | # Tests for SNI and DTLS |
| 4419 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4420 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4421 | run_test "SNI: DTLS, no SNI callback" \ |
| 4422 | "$P_SRV debug_level=3 dtls=1 \ |
| 4423 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4424 | "$P_CLI server_name=localhost dtls=1" \ |
| 4425 | 0 \ |
| 4426 | -S "parse ServerName extension" \ |
| 4427 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4428 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4429 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4430 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4431 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4432 | "$P_SRV debug_level=3 dtls=1 \ |
| 4433 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4434 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4435 | "$P_CLI server_name=localhost dtls=1" \ |
| 4436 | 0 \ |
| 4437 | -s "parse ServerName extension" \ |
| 4438 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4439 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4440 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4441 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4442 | run_test "SNI: DTLS, matching cert 2" \ |
| 4443 | "$P_SRV debug_level=3 dtls=1 \ |
| 4444 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4445 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4446 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4447 | 0 \ |
| 4448 | -s "parse ServerName extension" \ |
| 4449 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4450 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4451 | |
| 4452 | run_test "SNI: DTLS, no matching cert" \ |
| 4453 | "$P_SRV debug_level=3 dtls=1 \ |
| 4454 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4455 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4456 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4457 | 1 \ |
| 4458 | -s "parse ServerName extension" \ |
| 4459 | -s "ssl_sni_wrapper() returned" \ |
| 4460 | -s "mbedtls_ssl_handshake returned" \ |
| 4461 | -c "mbedtls_ssl_handshake returned" \ |
| 4462 | -c "SSL - A fatal alert message was received from our peer" |
| 4463 | |
| 4464 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4465 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4466 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4467 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4468 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4469 | 0 \ |
| 4470 | -S "skip write certificate request" \ |
| 4471 | -C "skip parse certificate request" \ |
| 4472 | -c "got a certificate request" \ |
| 4473 | -C "skip write certificate" \ |
| 4474 | -C "skip write certificate verify" \ |
| 4475 | -S "skip parse certificate verify" |
| 4476 | |
| 4477 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4478 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4479 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4480 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4481 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4482 | 0 \ |
| 4483 | -S "skip write certificate request" \ |
| 4484 | -C "skip parse certificate request" \ |
| 4485 | -c "got a certificate request" \ |
| 4486 | -C "skip write certificate" \ |
| 4487 | -C "skip write certificate verify" \ |
| 4488 | -S "skip parse certificate verify" |
| 4489 | |
| 4490 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4491 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4492 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4493 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4494 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4495 | 0 \ |
| 4496 | -s "skip write certificate request" \ |
| 4497 | -C "skip parse certificate request" \ |
| 4498 | -c "got no certificate request" \ |
| 4499 | -c "skip write certificate" \ |
| 4500 | -c "skip write certificate verify" \ |
| 4501 | -s "skip parse certificate verify" |
| 4502 | |
| 4503 | run_test "SNI: DTLS, CA no override" \ |
| 4504 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4505 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4506 | ca_file=data_files/test-ca.crt \ |
| 4507 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4508 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4509 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4510 | 1 \ |
| 4511 | -S "skip write certificate request" \ |
| 4512 | -C "skip parse certificate request" \ |
| 4513 | -c "got a certificate request" \ |
| 4514 | -C "skip write certificate" \ |
| 4515 | -C "skip write certificate verify" \ |
| 4516 | -S "skip parse certificate verify" \ |
| 4517 | -s "x509_verify_cert() returned" \ |
| 4518 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4519 | -S "The certificate has been revoked (is on a CRL)" |
| 4520 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4521 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4522 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4523 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4524 | ca_file=data_files/test-ca.crt \ |
| 4525 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4526 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4527 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4528 | 0 \ |
| 4529 | -S "skip write certificate request" \ |
| 4530 | -C "skip parse certificate request" \ |
| 4531 | -c "got a certificate request" \ |
| 4532 | -C "skip write certificate" \ |
| 4533 | -C "skip write certificate verify" \ |
| 4534 | -S "skip parse certificate verify" \ |
| 4535 | -S "x509_verify_cert() returned" \ |
| 4536 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4537 | -S "The certificate has been revoked (is on a CRL)" |
| 4538 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4539 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4540 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4541 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4542 | ca_file=data_files/test-ca.crt \ |
| 4543 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4544 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4545 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4546 | 1 \ |
| 4547 | -S "skip write certificate request" \ |
| 4548 | -C "skip parse certificate request" \ |
| 4549 | -c "got a certificate request" \ |
| 4550 | -C "skip write certificate" \ |
| 4551 | -C "skip write certificate verify" \ |
| 4552 | -S "skip parse certificate verify" \ |
| 4553 | -s "x509_verify_cert() returned" \ |
| 4554 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4555 | -s "The certificate has been revoked (is on a CRL)" |
| 4556 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4557 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4558 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4559 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4560 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4561 | "$P_CLI nbio=2 tickets=0" \ |
| 4562 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4563 | -S "mbedtls_ssl_handshake returned" \ |
| 4564 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4565 | -c "Read from server: .* bytes read" |
| 4566 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4567 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4568 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4569 | "$P_CLI nbio=2 tickets=0" \ |
| 4570 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4571 | -S "mbedtls_ssl_handshake returned" \ |
| 4572 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4573 | -c "Read from server: .* bytes read" |
| 4574 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4575 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4576 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4577 | "$P_CLI nbio=2 tickets=1" \ |
| 4578 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4579 | -S "mbedtls_ssl_handshake returned" \ |
| 4580 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4581 | -c "Read from server: .* bytes read" |
| 4582 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4583 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4584 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4585 | "$P_CLI nbio=2 tickets=1" \ |
| 4586 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4587 | -S "mbedtls_ssl_handshake returned" \ |
| 4588 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4589 | -c "Read from server: .* bytes read" |
| 4590 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4591 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4592 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4593 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4594 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4595 | -S "mbedtls_ssl_handshake returned" \ |
| 4596 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4597 | -c "Read from server: .* bytes read" |
| 4598 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4599 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4600 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4601 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4602 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4603 | -S "mbedtls_ssl_handshake returned" \ |
| 4604 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4605 | -c "Read from server: .* bytes read" |
| 4606 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4607 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4608 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4609 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4610 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4611 | -S "mbedtls_ssl_handshake returned" \ |
| 4612 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4613 | -c "Read from server: .* bytes read" |
| 4614 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4615 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4616 | |
| 4617 | run_test "Event-driven I/O: basic handshake" \ |
| 4618 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4619 | "$P_CLI event=1 tickets=0" \ |
| 4620 | 0 \ |
| 4621 | -S "mbedtls_ssl_handshake returned" \ |
| 4622 | -C "mbedtls_ssl_handshake returned" \ |
| 4623 | -c "Read from server: .* bytes read" |
| 4624 | |
| 4625 | run_test "Event-driven I/O: client auth" \ |
| 4626 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4627 | "$P_CLI event=1 tickets=0" \ |
| 4628 | 0 \ |
| 4629 | -S "mbedtls_ssl_handshake returned" \ |
| 4630 | -C "mbedtls_ssl_handshake returned" \ |
| 4631 | -c "Read from server: .* bytes read" |
| 4632 | |
| 4633 | run_test "Event-driven I/O: ticket" \ |
| 4634 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4635 | "$P_CLI event=1 tickets=1" \ |
| 4636 | 0 \ |
| 4637 | -S "mbedtls_ssl_handshake returned" \ |
| 4638 | -C "mbedtls_ssl_handshake returned" \ |
| 4639 | -c "Read from server: .* bytes read" |
| 4640 | |
| 4641 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4642 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4643 | "$P_CLI event=1 tickets=1" \ |
| 4644 | 0 \ |
| 4645 | -S "mbedtls_ssl_handshake returned" \ |
| 4646 | -C "mbedtls_ssl_handshake returned" \ |
| 4647 | -c "Read from server: .* bytes read" |
| 4648 | |
| 4649 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4650 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4651 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4652 | 0 \ |
| 4653 | -S "mbedtls_ssl_handshake returned" \ |
| 4654 | -C "mbedtls_ssl_handshake returned" \ |
| 4655 | -c "Read from server: .* bytes read" |
| 4656 | |
| 4657 | run_test "Event-driven I/O: ticket + resume" \ |
| 4658 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4659 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4660 | 0 \ |
| 4661 | -S "mbedtls_ssl_handshake returned" \ |
| 4662 | -C "mbedtls_ssl_handshake returned" \ |
| 4663 | -c "Read from server: .* bytes read" |
| 4664 | |
| 4665 | run_test "Event-driven I/O: session-id resume" \ |
| 4666 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4667 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4668 | 0 \ |
| 4669 | -S "mbedtls_ssl_handshake returned" \ |
| 4670 | -C "mbedtls_ssl_handshake returned" \ |
| 4671 | -c "Read from server: .* bytes read" |
| 4672 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4673 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4674 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4675 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4676 | 0 \ |
| 4677 | -c "Read from server: .* bytes read" |
| 4678 | |
| 4679 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4680 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4681 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4682 | 0 \ |
| 4683 | -c "Read from server: .* bytes read" |
| 4684 | |
| 4685 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4686 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4687 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4688 | 0 \ |
| 4689 | -c "Read from server: .* bytes read" |
| 4690 | |
| 4691 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4692 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4693 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4694 | 0 \ |
| 4695 | -c "Read from server: .* bytes read" |
| 4696 | |
| 4697 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4698 | "$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] | 4699 | "$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] | 4700 | 0 \ |
| 4701 | -c "Read from server: .* bytes read" |
| 4702 | |
| 4703 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4704 | "$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] | 4705 | "$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] | 4706 | 0 \ |
| 4707 | -c "Read from server: .* bytes read" |
| 4708 | |
| 4709 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4710 | "$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] | 4711 | "$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] | 4712 | 0 \ |
| 4713 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4714 | |
| 4715 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4716 | # During session resumption, the client will send its ApplicationData record |
| 4717 | # within the same datagram as the Finished messages. In this situation, the |
| 4718 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4719 | # because the ApplicationData request has already been queued internally. |
| 4720 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4721 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4722 | "$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] | 4723 | "$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] | 4724 | 0 \ |
| 4725 | -c "Read from server: .* bytes read" |
| 4726 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4727 | # Tests for version negotiation |
| 4728 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4729 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4730 | "$P_SRV" \ |
| 4731 | "$P_CLI" \ |
| 4732 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4733 | -S "mbedtls_ssl_handshake returned" \ |
| 4734 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4735 | -s "Protocol is TLSv1.2" \ |
| 4736 | -c "Protocol is TLSv1.2" |
| 4737 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 4738 | run_test "Not supported version check: cli TLS 1.0" \ |
| 4739 | "$P_SRV" \ |
| 4740 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 4741 | 1 \ |
| 4742 | -s "Handshake protocol not within min/max boundaries" \ |
| 4743 | -c "Error in protocol version" \ |
| 4744 | -S "Protocol is TLSv1.0" \ |
| 4745 | -C "Handshake was completed" |
| 4746 | |
| 4747 | run_test "Not supported version check: cli TLS 1.1" \ |
| 4748 | "$P_SRV" \ |
| 4749 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 4750 | 1 \ |
| 4751 | -s "Handshake protocol not within min/max boundaries" \ |
| 4752 | -c "Error in protocol version" \ |
| 4753 | -S "Protocol is TLSv1.1" \ |
| 4754 | -C "Handshake was completed" |
| 4755 | |
| 4756 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 4757 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 4758 | "$P_CLI" \ |
| 4759 | 1 \ |
| 4760 | -s "Error in protocol version" \ |
| 4761 | -c "Handshake protocol not within min/max boundaries" \ |
| 4762 | -S "Version: TLS1.0" \ |
| 4763 | -C "Protocol is TLSv1.0" |
| 4764 | |
| 4765 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 4766 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 4767 | "$P_CLI" \ |
| 4768 | 1 \ |
| 4769 | -s "Error in protocol version" \ |
| 4770 | -c "Handshake protocol not within min/max boundaries" \ |
| 4771 | -S "Version: TLS1.1" \ |
| 4772 | -C "Protocol is TLSv1.1" |
| 4773 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4774 | # Tests for ALPN extension |
| 4775 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4776 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4777 | "$P_SRV debug_level=3" \ |
| 4778 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4779 | 0 \ |
| 4780 | -C "client hello, adding alpn extension" \ |
| 4781 | -S "found alpn extension" \ |
| 4782 | -C "got an alert message, type: \\[2:120]" \ |
| 4783 | -S "server hello, adding alpn extension" \ |
| 4784 | -C "found alpn extension " \ |
| 4785 | -C "Application Layer Protocol is" \ |
| 4786 | -S "Application Layer Protocol is" |
| 4787 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4788 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4789 | "$P_SRV debug_level=3" \ |
| 4790 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4791 | 0 \ |
| 4792 | -c "client hello, adding alpn extension" \ |
| 4793 | -s "found alpn extension" \ |
| 4794 | -C "got an alert message, type: \\[2:120]" \ |
| 4795 | -S "server hello, adding alpn extension" \ |
| 4796 | -C "found alpn extension " \ |
| 4797 | -c "Application Layer Protocol is (none)" \ |
| 4798 | -S "Application Layer Protocol is" |
| 4799 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4800 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4801 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4802 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4803 | 0 \ |
| 4804 | -C "client hello, adding alpn extension" \ |
| 4805 | -S "found alpn extension" \ |
| 4806 | -C "got an alert message, type: \\[2:120]" \ |
| 4807 | -S "server hello, adding alpn extension" \ |
| 4808 | -C "found alpn extension " \ |
| 4809 | -C "Application Layer Protocol is" \ |
| 4810 | -s "Application Layer Protocol is (none)" |
| 4811 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4812 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4813 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4814 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4815 | 0 \ |
| 4816 | -c "client hello, adding alpn extension" \ |
| 4817 | -s "found alpn extension" \ |
| 4818 | -C "got an alert message, type: \\[2:120]" \ |
| 4819 | -s "server hello, adding alpn extension" \ |
| 4820 | -c "found alpn extension" \ |
| 4821 | -c "Application Layer Protocol is abc" \ |
| 4822 | -s "Application Layer Protocol is abc" |
| 4823 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4824 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4825 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4826 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4827 | 0 \ |
| 4828 | -c "client hello, adding alpn extension" \ |
| 4829 | -s "found alpn extension" \ |
| 4830 | -C "got an alert message, type: \\[2:120]" \ |
| 4831 | -s "server hello, adding alpn extension" \ |
| 4832 | -c "found alpn extension" \ |
| 4833 | -c "Application Layer Protocol is abc" \ |
| 4834 | -s "Application Layer Protocol is abc" |
| 4835 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4836 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4837 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4838 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4839 | 0 \ |
| 4840 | -c "client hello, adding alpn extension" \ |
| 4841 | -s "found alpn extension" \ |
| 4842 | -C "got an alert message, type: \\[2:120]" \ |
| 4843 | -s "server hello, adding alpn extension" \ |
| 4844 | -c "found alpn extension" \ |
| 4845 | -c "Application Layer Protocol is 1234" \ |
| 4846 | -s "Application Layer Protocol is 1234" |
| 4847 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4848 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4849 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4850 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4851 | 1 \ |
| 4852 | -c "client hello, adding alpn extension" \ |
| 4853 | -s "found alpn extension" \ |
| 4854 | -c "got an alert message, type: \\[2:120]" \ |
| 4855 | -S "server hello, adding alpn extension" \ |
| 4856 | -C "found alpn extension" \ |
| 4857 | -C "Application Layer Protocol is 1234" \ |
| 4858 | -S "Application Layer Protocol is 1234" |
| 4859 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4860 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4861 | # Tests for keyUsage in leaf certificates, part 1: |
| 4862 | # server-side certificate/suite selection |
| 4863 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4864 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4865 | "$P_SRV key_file=data_files/server2.key \ |
| 4866 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4867 | "$P_CLI" \ |
| 4868 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4869 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4870 | |
| 4871 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4872 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4873 | "$P_SRV key_file=data_files/server2.key \ |
| 4874 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4875 | "$P_CLI" \ |
| 4876 | 0 \ |
| 4877 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4878 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4879 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4880 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4881 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4882 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4883 | 1 \ |
| 4884 | -C "Ciphersuite is " |
| 4885 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4886 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4887 | "$P_SRV key_file=data_files/server5.key \ |
| 4888 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4889 | "$P_CLI" \ |
| 4890 | 0 \ |
| 4891 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4892 | |
| 4893 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4894 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4895 | "$P_SRV key_file=data_files/server5.key \ |
| 4896 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4897 | "$P_CLI" \ |
| 4898 | 0 \ |
| 4899 | -c "Ciphersuite is TLS-ECDH-" |
| 4900 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4901 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4902 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4903 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4904 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4905 | 1 \ |
| 4906 | -C "Ciphersuite is " |
| 4907 | |
| 4908 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4909 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4910 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4911 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4912 | "$O_SRV -key data_files/server2.key \ |
| 4913 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4914 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4915 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4916 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4917 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4918 | -C "Processing of the Certificate handshake message failed" \ |
| 4919 | -c "Ciphersuite is TLS-" |
| 4920 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4921 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4922 | "$O_SRV -key data_files/server2.key \ |
| 4923 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4924 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4925 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4926 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4927 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4928 | -C "Processing of the Certificate handshake message failed" \ |
| 4929 | -c "Ciphersuite is TLS-" |
| 4930 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4931 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4932 | "$O_SRV -key data_files/server2.key \ |
| 4933 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4934 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4935 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4936 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4937 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4938 | -C "Processing of the Certificate handshake message failed" \ |
| 4939 | -c "Ciphersuite is TLS-" |
| 4940 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4941 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4942 | "$O_SRV -key data_files/server2.key \ |
| 4943 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4944 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4945 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4946 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4947 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4948 | -c "Processing of the Certificate handshake message failed" \ |
| 4949 | -C "Ciphersuite is TLS-" |
| 4950 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4951 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 4952 | "$O_SRV -key data_files/server2.key \ |
| 4953 | -cert data_files/server2.ku-ke.crt" \ |
| 4954 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4955 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4956 | 0 \ |
| 4957 | -c "bad certificate (usage extensions)" \ |
| 4958 | -C "Processing of the Certificate handshake message failed" \ |
| 4959 | -c "Ciphersuite is TLS-" \ |
| 4960 | -c "! Usage does not match the keyUsage extension" |
| 4961 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4962 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4963 | "$O_SRV -key data_files/server2.key \ |
| 4964 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4965 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4966 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4967 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4968 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4969 | -C "Processing of the Certificate handshake message failed" \ |
| 4970 | -c "Ciphersuite is TLS-" |
| 4971 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4972 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4973 | "$O_SRV -key data_files/server2.key \ |
| 4974 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4975 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4976 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4977 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4978 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4979 | -c "Processing of the Certificate handshake message failed" \ |
| 4980 | -C "Ciphersuite is TLS-" |
| 4981 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4982 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 4983 | "$O_SRV -key data_files/server2.key \ |
| 4984 | -cert data_files/server2.ku-ds.crt" \ |
| 4985 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4986 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4987 | 0 \ |
| 4988 | -c "bad certificate (usage extensions)" \ |
| 4989 | -C "Processing of the Certificate handshake message failed" \ |
| 4990 | -c "Ciphersuite is TLS-" \ |
| 4991 | -c "! Usage does not match the keyUsage extension" |
| 4992 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4993 | # Tests for keyUsage in leaf certificates, part 3: |
| 4994 | # server-side checking of client cert |
| 4995 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4996 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4997 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4998 | "$O_CLI -key data_files/server2.key \ |
| 4999 | -cert data_files/server2.ku-ds.crt" \ |
| 5000 | 0 \ |
| 5001 | -S "bad certificate (usage extensions)" \ |
| 5002 | -S "Processing of the Certificate handshake message failed" |
| 5003 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5004 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5005 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5006 | "$O_CLI -key data_files/server2.key \ |
| 5007 | -cert data_files/server2.ku-ke.crt" \ |
| 5008 | 0 \ |
| 5009 | -s "bad certificate (usage extensions)" \ |
| 5010 | -S "Processing of the Certificate handshake message failed" |
| 5011 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5012 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5013 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5014 | "$O_CLI -key data_files/server2.key \ |
| 5015 | -cert data_files/server2.ku-ke.crt" \ |
| 5016 | 1 \ |
| 5017 | -s "bad certificate (usage extensions)" \ |
| 5018 | -s "Processing of the Certificate handshake message failed" |
| 5019 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5020 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5021 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5022 | "$O_CLI -key data_files/server5.key \ |
| 5023 | -cert data_files/server5.ku-ds.crt" \ |
| 5024 | 0 \ |
| 5025 | -S "bad certificate (usage extensions)" \ |
| 5026 | -S "Processing of the Certificate handshake message failed" |
| 5027 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5028 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5029 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5030 | "$O_CLI -key data_files/server5.key \ |
| 5031 | -cert data_files/server5.ku-ka.crt" \ |
| 5032 | 0 \ |
| 5033 | -s "bad certificate (usage extensions)" \ |
| 5034 | -S "Processing of the Certificate handshake message failed" |
| 5035 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5036 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5037 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5038 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5039 | "$P_SRV key_file=data_files/server5.key \ |
| 5040 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5041 | "$P_CLI" \ |
| 5042 | 0 |
| 5043 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5044 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5045 | "$P_SRV key_file=data_files/server5.key \ |
| 5046 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5047 | "$P_CLI" \ |
| 5048 | 0 |
| 5049 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5050 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5051 | "$P_SRV key_file=data_files/server5.key \ |
| 5052 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5053 | "$P_CLI" \ |
| 5054 | 0 |
| 5055 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5056 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5057 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5058 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5059 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5060 | 1 |
| 5061 | |
| 5062 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5063 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5064 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5065 | "$O_SRV -key data_files/server5.key \ |
| 5066 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5067 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5068 | 0 \ |
| 5069 | -C "bad certificate (usage extensions)" \ |
| 5070 | -C "Processing of the Certificate handshake message failed" \ |
| 5071 | -c "Ciphersuite is TLS-" |
| 5072 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5073 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5074 | "$O_SRV -key data_files/server5.key \ |
| 5075 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5076 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5077 | 0 \ |
| 5078 | -C "bad certificate (usage extensions)" \ |
| 5079 | -C "Processing of the Certificate handshake message failed" \ |
| 5080 | -c "Ciphersuite is TLS-" |
| 5081 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5082 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5083 | "$O_SRV -key data_files/server5.key \ |
| 5084 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5085 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5086 | 0 \ |
| 5087 | -C "bad certificate (usage extensions)" \ |
| 5088 | -C "Processing of the Certificate handshake message failed" \ |
| 5089 | -c "Ciphersuite is TLS-" |
| 5090 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5091 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5092 | "$O_SRV -key data_files/server5.key \ |
| 5093 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5094 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5095 | 1 \ |
| 5096 | -c "bad certificate (usage extensions)" \ |
| 5097 | -c "Processing of the Certificate handshake message failed" \ |
| 5098 | -C "Ciphersuite is TLS-" |
| 5099 | |
| 5100 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5101 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5102 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5103 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5104 | "$O_CLI -key data_files/server5.key \ |
| 5105 | -cert data_files/server5.eku-cli.crt" \ |
| 5106 | 0 \ |
| 5107 | -S "bad certificate (usage extensions)" \ |
| 5108 | -S "Processing of the Certificate handshake message failed" |
| 5109 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5110 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5111 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5112 | "$O_CLI -key data_files/server5.key \ |
| 5113 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5114 | 0 \ |
| 5115 | -S "bad certificate (usage extensions)" \ |
| 5116 | -S "Processing of the Certificate handshake message failed" |
| 5117 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5118 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5119 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5120 | "$O_CLI -key data_files/server5.key \ |
| 5121 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5122 | 0 \ |
| 5123 | -S "bad certificate (usage extensions)" \ |
| 5124 | -S "Processing of the Certificate handshake message failed" |
| 5125 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5126 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5127 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5128 | "$O_CLI -key data_files/server5.key \ |
| 5129 | -cert data_files/server5.eku-cs.crt" \ |
| 5130 | 0 \ |
| 5131 | -s "bad certificate (usage extensions)" \ |
| 5132 | -S "Processing of the Certificate handshake message failed" |
| 5133 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5134 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5135 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5136 | "$O_CLI -key data_files/server5.key \ |
| 5137 | -cert data_files/server5.eku-cs.crt" \ |
| 5138 | 1 \ |
| 5139 | -s "bad certificate (usage extensions)" \ |
| 5140 | -s "Processing of the Certificate handshake message failed" |
| 5141 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5142 | # Tests for DHM parameters loading |
| 5143 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5144 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5145 | "$P_SRV" \ |
| 5146 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5147 | debug_level=3" \ |
| 5148 | 0 \ |
| 5149 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5150 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5151 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5152 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5153 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5154 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5155 | debug_level=3" \ |
| 5156 | 0 \ |
| 5157 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5158 | -c "value of 'DHM: G ' (2 bits)" |
| 5159 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5160 | # Tests for DHM client-side size checking |
| 5161 | |
| 5162 | run_test "DHM size: server default, client default, OK" \ |
| 5163 | "$P_SRV" \ |
| 5164 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5165 | debug_level=1" \ |
| 5166 | 0 \ |
| 5167 | -C "DHM prime too short:" |
| 5168 | |
| 5169 | run_test "DHM size: server default, client 2048, OK" \ |
| 5170 | "$P_SRV" \ |
| 5171 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5172 | debug_level=1 dhmlen=2048" \ |
| 5173 | 0 \ |
| 5174 | -C "DHM prime too short:" |
| 5175 | |
| 5176 | run_test "DHM size: server 1024, client default, OK" \ |
| 5177 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5178 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5179 | debug_level=1" \ |
| 5180 | 0 \ |
| 5181 | -C "DHM prime too short:" |
| 5182 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5183 | run_test "DHM size: server 999, client 999, OK" \ |
| 5184 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5185 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5186 | debug_level=1 dhmlen=999" \ |
| 5187 | 0 \ |
| 5188 | -C "DHM prime too short:" |
| 5189 | |
| 5190 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5191 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5192 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5193 | debug_level=1 dhmlen=1000" \ |
| 5194 | 0 \ |
| 5195 | -C "DHM prime too short:" |
| 5196 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5197 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5198 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5199 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5200 | debug_level=1" \ |
| 5201 | 1 \ |
| 5202 | -c "DHM prime too short:" |
| 5203 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5204 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5205 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5206 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5207 | debug_level=1 dhmlen=1001" \ |
| 5208 | 1 \ |
| 5209 | -c "DHM prime too short:" |
| 5210 | |
| 5211 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5212 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5213 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5214 | debug_level=1 dhmlen=1000" \ |
| 5215 | 1 \ |
| 5216 | -c "DHM prime too short:" |
| 5217 | |
| 5218 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5219 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5220 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5221 | debug_level=1 dhmlen=999" \ |
| 5222 | 1 \ |
| 5223 | -c "DHM prime too short:" |
| 5224 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5225 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5226 | "$P_SRV" \ |
| 5227 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5228 | debug_level=1 dhmlen=2049" \ |
| 5229 | 1 \ |
| 5230 | -c "DHM prime too short:" |
| 5231 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5232 | # Tests for PSK callback |
| 5233 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5234 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5235 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5236 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5237 | psk_identity=foo psk=abc123" \ |
| 5238 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5239 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5240 | -S "SSL - Unknown identity received" \ |
| 5241 | -S "SSL - Verification of the message MAC failed" |
| 5242 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5243 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5244 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5245 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5246 | "$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] | 5247 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5248 | 0 \ |
| 5249 | -c "skip PMS generation for opaque PSK"\ |
| 5250 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5251 | -C "session hash for extended master secret"\ |
| 5252 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5253 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5254 | -S "SSL - Unknown identity received" \ |
| 5255 | -S "SSL - Verification of the message MAC failed" |
| 5256 | |
| 5257 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5258 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5259 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5260 | "$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] | 5261 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5262 | 0 \ |
| 5263 | -c "skip PMS generation for opaque PSK"\ |
| 5264 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5265 | -C "session hash for extended master secret"\ |
| 5266 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5267 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5268 | -S "SSL - Unknown identity received" \ |
| 5269 | -S "SSL - Verification of the message MAC failed" |
| 5270 | |
| 5271 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5272 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5273 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5274 | "$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] | 5275 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5276 | 0 \ |
| 5277 | -c "skip PMS generation for opaque PSK"\ |
| 5278 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5279 | -c "session hash for extended master secret"\ |
| 5280 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5281 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5282 | -S "SSL - Unknown identity received" \ |
| 5283 | -S "SSL - Verification of the message MAC failed" |
| 5284 | |
| 5285 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5286 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5287 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5288 | "$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] | 5289 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5290 | 0 \ |
| 5291 | -c "skip PMS generation for opaque PSK"\ |
| 5292 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5293 | -c "session hash for extended master secret"\ |
| 5294 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5295 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5296 | -S "SSL - Unknown identity received" \ |
| 5297 | -S "SSL - Verification of the message MAC failed" |
| 5298 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5299 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5300 | 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] | 5301 | "$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] | 5302 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5303 | psk_identity=foo psk=abc123" \ |
| 5304 | 0 \ |
| 5305 | -C "skip PMS generation for opaque PSK"\ |
| 5306 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5307 | -C "session hash for extended master secret"\ |
| 5308 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5309 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5310 | -S "SSL - Unknown identity received" \ |
| 5311 | -S "SSL - Verification of the message MAC failed" |
| 5312 | |
| 5313 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5314 | 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] | 5315 | "$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] | 5316 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5317 | psk_identity=foo psk=abc123" \ |
| 5318 | 0 \ |
| 5319 | -C "skip PMS generation for opaque PSK"\ |
| 5320 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5321 | -C "session hash for extended master secret"\ |
| 5322 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5323 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5324 | -S "SSL - Unknown identity received" \ |
| 5325 | -S "SSL - Verification of the message MAC failed" |
| 5326 | |
| 5327 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5328 | 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] | 5329 | "$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] | 5330 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5331 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5332 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5333 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5334 | -c "session hash for extended master secret"\ |
| 5335 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5336 | -C "skip PMS generation for opaque PSK"\ |
| 5337 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5338 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5339 | -S "SSL - Unknown identity received" \ |
| 5340 | -S "SSL - Verification of the message MAC failed" |
| 5341 | |
| 5342 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5343 | 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] | 5344 | "$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] | 5345 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5346 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5347 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5348 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5349 | -c "session hash for extended master secret"\ |
| 5350 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5351 | -C "skip PMS generation for opaque PSK"\ |
| 5352 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5353 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5354 | -S "SSL - Unknown identity received" \ |
| 5355 | -S "SSL - Verification of the message MAC failed" |
| 5356 | |
| 5357 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5358 | 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] | 5359 | "$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] | 5360 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5361 | psk_identity=def psk=beef" \ |
| 5362 | 0 \ |
| 5363 | -C "skip PMS generation for opaque PSK"\ |
| 5364 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5365 | -C "session hash for extended master secret"\ |
| 5366 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5367 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5368 | -S "SSL - Unknown identity received" \ |
| 5369 | -S "SSL - Verification of the message MAC failed" |
| 5370 | |
| 5371 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5372 | 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] | 5373 | "$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] | 5374 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5375 | psk_identity=def psk=beef" \ |
| 5376 | 0 \ |
| 5377 | -C "skip PMS generation for opaque PSK"\ |
| 5378 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5379 | -C "session hash for extended master secret"\ |
| 5380 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5381 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5382 | -S "SSL - Unknown identity received" \ |
| 5383 | -S "SSL - Verification of the message MAC failed" |
| 5384 | |
| 5385 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5386 | 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] | 5387 | "$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] | 5388 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5389 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5390 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5391 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5392 | -c "session hash for extended master secret"\ |
| 5393 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5394 | -C "skip PMS generation for opaque PSK"\ |
| 5395 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5396 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5397 | -S "SSL - Unknown identity received" \ |
| 5398 | -S "SSL - Verification of the message MAC failed" |
| 5399 | |
| 5400 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5401 | 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] | 5402 | "$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] | 5403 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5404 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5405 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5406 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5407 | -c "session hash for extended master secret"\ |
| 5408 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5409 | -C "skip PMS generation for opaque PSK"\ |
| 5410 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5411 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5412 | -S "SSL - Unknown identity received" \ |
| 5413 | -S "SSL - Verification of the message MAC failed" |
| 5414 | |
| 5415 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5416 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5417 | "$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] | 5418 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5419 | psk_identity=def psk=beef" \ |
| 5420 | 0 \ |
| 5421 | -C "skip PMS generation for opaque PSK"\ |
| 5422 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5423 | -C "session hash for extended master secret"\ |
| 5424 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5425 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5426 | -S "SSL - Unknown identity received" \ |
| 5427 | -S "SSL - Verification of the message MAC failed" |
| 5428 | |
| 5429 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5430 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5431 | "$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] | 5432 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5433 | psk_identity=def psk=beef" \ |
| 5434 | 0 \ |
| 5435 | -C "skip PMS generation for opaque PSK"\ |
| 5436 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5437 | -C "session hash for extended master secret"\ |
| 5438 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5439 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5440 | -S "SSL - Unknown identity received" \ |
| 5441 | -S "SSL - Verification of the message MAC failed" |
| 5442 | |
| 5443 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5444 | 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] | 5445 | "$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] | 5446 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5447 | psk_identity=def psk=beef" \ |
| 5448 | 0 \ |
| 5449 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5450 | -C "session hash for extended master secret"\ |
| 5451 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5452 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5453 | -S "SSL - Unknown identity received" \ |
| 5454 | -S "SSL - Verification of the message MAC failed" |
| 5455 | |
| 5456 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5457 | 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] | 5458 | "$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] | 5459 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5460 | psk_identity=def psk=beef" \ |
| 5461 | 0 \ |
| 5462 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5463 | -C "session hash for extended master secret"\ |
| 5464 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5465 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5466 | -S "SSL - Unknown identity received" \ |
| 5467 | -S "SSL - Verification of the message MAC failed" |
| 5468 | |
| 5469 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5470 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5471 | "$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] | 5472 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5473 | psk_identity=def psk=beef" \ |
| 5474 | 1 \ |
| 5475 | -s "SSL - Verification of the message MAC failed" |
| 5476 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5477 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5478 | "$P_SRV" \ |
| 5479 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5480 | psk_identity=foo psk=abc123" \ |
| 5481 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5482 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5483 | -S "SSL - Unknown identity received" \ |
| 5484 | -S "SSL - Verification of the message MAC failed" |
| 5485 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5486 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5487 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5488 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5489 | psk_identity=foo psk=abc123" \ |
| 5490 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5491 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5492 | -s "SSL - Unknown identity received" \ |
| 5493 | -S "SSL - Verification of the message MAC failed" |
| 5494 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5495 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5496 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5497 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5498 | psk_identity=abc psk=dead" \ |
| 5499 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5500 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5501 | -S "SSL - Unknown identity received" \ |
| 5502 | -S "SSL - Verification of the message MAC failed" |
| 5503 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5504 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5505 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5506 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5507 | psk_identity=def psk=beef" \ |
| 5508 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5509 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5510 | -S "SSL - Unknown identity received" \ |
| 5511 | -S "SSL - Verification of the message MAC failed" |
| 5512 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5513 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5514 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5515 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5516 | psk_identity=ghi psk=beef" \ |
| 5517 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5518 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5519 | -s "SSL - Unknown identity received" \ |
| 5520 | -S "SSL - Verification of the message MAC failed" |
| 5521 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5522 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5523 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5524 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5525 | psk_identity=abc psk=beef" \ |
| 5526 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5527 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5528 | -S "SSL - Unknown identity received" \ |
| 5529 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5530 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5531 | # Tests for EC J-PAKE |
| 5532 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5533 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5534 | run_test "ECJPAKE: client not configured" \ |
| 5535 | "$P_SRV debug_level=3" \ |
| 5536 | "$P_CLI debug_level=3" \ |
| 5537 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5538 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5539 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5540 | -S "found ecjpake kkpp extension" \ |
| 5541 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5542 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5543 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5544 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5545 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5546 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5547 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5548 | run_test "ECJPAKE: server not configured" \ |
| 5549 | "$P_SRV debug_level=3" \ |
| 5550 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5551 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5552 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5553 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5554 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5555 | -s "found ecjpake kkpp extension" \ |
| 5556 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5557 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5558 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5559 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5560 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5561 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5562 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5563 | run_test "ECJPAKE: working, TLS" \ |
| 5564 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5565 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5566 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5567 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5568 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5569 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5570 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5571 | -s "found ecjpake kkpp extension" \ |
| 5572 | -S "skip ecjpake kkpp extension" \ |
| 5573 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5574 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5575 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5576 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5577 | -S "SSL - Verification of the message MAC failed" |
| 5578 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5579 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5580 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5581 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5582 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5583 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5584 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5585 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5586 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5587 | -s "SSL - Verification of the message MAC failed" |
| 5588 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5589 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5590 | run_test "ECJPAKE: working, DTLS" \ |
| 5591 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5592 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5593 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5594 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5595 | -c "re-using cached ecjpake parameters" \ |
| 5596 | -S "SSL - Verification of the message MAC failed" |
| 5597 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5598 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5599 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5600 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5601 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5602 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5603 | 0 \ |
| 5604 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5605 | -S "SSL - Verification of the message MAC failed" |
| 5606 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5607 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5608 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5609 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5610 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5611 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5612 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5613 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5614 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5615 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5616 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5617 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5618 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5619 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5620 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5621 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5622 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5623 | 0 |
| 5624 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5625 | # Test for ClientHello without extensions |
| 5626 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5627 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5628 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5629 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5630 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5631 | 0 \ |
| 5632 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5633 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5634 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5635 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5636 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5637 | "$P_SRV" \ |
| 5638 | "$P_CLI request_size=100" \ |
| 5639 | 0 \ |
| 5640 | -s "Read from client: 100 bytes read$" |
| 5641 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5642 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5643 | "$P_SRV" \ |
| 5644 | "$P_CLI request_size=500" \ |
| 5645 | 0 \ |
| 5646 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5647 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5648 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5649 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5650 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5651 | "$P_SRV" \ |
| 5652 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5653 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5654 | 0 \ |
| 5655 | -s "Read from client: 1 bytes read" |
| 5656 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5657 | 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] | 5658 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5659 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5660 | 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] | 5661 | 0 \ |
| 5662 | -s "Read from client: 1 bytes read" |
| 5663 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5664 | 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] | 5665 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5666 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5667 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5668 | 0 \ |
| 5669 | -s "Read from client: 1 bytes read" |
| 5670 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5671 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5672 | "$P_SRV" \ |
| 5673 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5674 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5675 | 0 \ |
| 5676 | -s "Read from client: 1 bytes read" |
| 5677 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5678 | 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] | 5679 | "$P_SRV" \ |
| 5680 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5681 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5682 | 0 \ |
| 5683 | -s "Read from client: 1 bytes read" |
| 5684 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5685 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5686 | |
| 5687 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5688 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5689 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5690 | "$P_CLI dtls=1 request_size=1 \ |
| 5691 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5692 | 0 \ |
| 5693 | -s "Read from client: 1 bytes read" |
| 5694 | |
| 5695 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5696 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5697 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5698 | "$P_CLI dtls=1 request_size=1 \ |
| 5699 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5700 | 0 \ |
| 5701 | -s "Read from client: 1 bytes read" |
| 5702 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5703 | # Tests for small server packets |
| 5704 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5705 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5706 | "$P_SRV response_size=1" \ |
| 5707 | "$P_CLI force_version=tls1_2 \ |
| 5708 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5709 | 0 \ |
| 5710 | -c "Read from server: 1 bytes read" |
| 5711 | |
| 5712 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5713 | "$P_SRV response_size=1" \ |
| 5714 | "$P_CLI force_version=tls1_2 \ |
| 5715 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5716 | 0 \ |
| 5717 | -c "Read from server: 1 bytes read" |
| 5718 | |
| 5719 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5720 | "$P_SRV response_size=1" \ |
| 5721 | "$P_CLI force_version=tls1_2 \ |
| 5722 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5723 | 0 \ |
| 5724 | -c "Read from server: 1 bytes read" |
| 5725 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5726 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5727 | "$P_SRV response_size=1" \ |
| 5728 | "$P_CLI force_version=tls1_2 \ |
| 5729 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5730 | 0 \ |
| 5731 | -c "Read from server: 1 bytes read" |
| 5732 | |
| 5733 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5734 | "$P_SRV response_size=1" \ |
| 5735 | "$P_CLI force_version=tls1_2 \ |
| 5736 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5737 | 0 \ |
| 5738 | -c "Read from server: 1 bytes read" |
| 5739 | |
| 5740 | # Tests for small server packets in DTLS |
| 5741 | |
| 5742 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5743 | run_test "Small server packet DTLS 1.2" \ |
| 5744 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5745 | "$P_CLI dtls=1 \ |
| 5746 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5747 | 0 \ |
| 5748 | -c "Read from server: 1 bytes read" |
| 5749 | |
| 5750 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5751 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5752 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5753 | "$P_CLI dtls=1 \ |
| 5754 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5755 | 0 \ |
| 5756 | -c "Read from server: 1 bytes read" |
| 5757 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5758 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5759 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5760 | # How many fragments do we expect to write $1 bytes? |
| 5761 | fragments_for_write() { |
| 5762 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5763 | } |
| 5764 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5765 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5766 | "$P_SRV" \ |
| 5767 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5768 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5769 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5770 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5771 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5772 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5773 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5774 | "$P_SRV" \ |
| 5775 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5776 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5777 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5778 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5779 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5780 | 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] | 5781 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5782 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5783 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5784 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5785 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5786 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5787 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5788 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5789 | "$P_SRV" \ |
| 5790 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5791 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5792 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5793 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5794 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5795 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5796 | 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] | 5797 | "$P_SRV" \ |
| 5798 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5799 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5800 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5801 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5802 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5803 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 5804 | # 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] | 5805 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5806 | "$P_SRV response_size=16384" \ |
| 5807 | "$P_CLI force_version=tls1_2 \ |
| 5808 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5809 | 0 \ |
| 5810 | -c "Read from server: 16384 bytes read" |
| 5811 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5812 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5813 | "$P_SRV response_size=16384" \ |
| 5814 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5815 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5816 | 0 \ |
| 5817 | -s "16384 bytes written in 1 fragments" \ |
| 5818 | -c "Read from server: 16384 bytes read" |
| 5819 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5820 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5821 | "$P_SRV response_size=16384" \ |
| 5822 | "$P_CLI force_version=tls1_2 \ |
| 5823 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5824 | 0 \ |
| 5825 | -c "Read from server: 16384 bytes read" |
| 5826 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5827 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5828 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5829 | "$P_CLI force_version=tls1_2 \ |
| 5830 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5831 | 0 \ |
| 5832 | -s "16384 bytes written in 1 fragments" \ |
| 5833 | -c "Read from server: 16384 bytes read" |
| 5834 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5835 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5836 | "$P_SRV response_size=16384" \ |
| 5837 | "$P_CLI force_version=tls1_2 \ |
| 5838 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5839 | 0 \ |
| 5840 | -c "Read from server: 16384 bytes read" |
| 5841 | |
| 5842 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5843 | "$P_SRV response_size=16384" \ |
| 5844 | "$P_CLI force_version=tls1_2 \ |
| 5845 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5846 | 0 \ |
| 5847 | -c "Read from server: 16384 bytes read" |
| 5848 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5849 | # Tests for restartable ECC |
| 5850 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5851 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 5852 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5853 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5854 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5855 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5856 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5857 | "$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] | 5858 | 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] | 5859 | debug_level=1" \ |
| 5860 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5861 | -C "x509_verify_cert.*4b00" \ |
| 5862 | -C "mbedtls_pk_verify.*4b00" \ |
| 5863 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5864 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5865 | |
| 5866 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5867 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5868 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5869 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5870 | "$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] | 5871 | 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] | 5872 | debug_level=1 ec_max_ops=0" \ |
| 5873 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5874 | -C "x509_verify_cert.*4b00" \ |
| 5875 | -C "mbedtls_pk_verify.*4b00" \ |
| 5876 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5877 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5878 | |
| 5879 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5880 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5881 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5882 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5883 | "$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] | 5884 | 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] | 5885 | debug_level=1 ec_max_ops=65535" \ |
| 5886 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5887 | -C "x509_verify_cert.*4b00" \ |
| 5888 | -C "mbedtls_pk_verify.*4b00" \ |
| 5889 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5890 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5891 | |
| 5892 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5893 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5894 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5895 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5896 | "$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] | 5897 | 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] | 5898 | debug_level=1 ec_max_ops=1000" \ |
| 5899 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5900 | -c "x509_verify_cert.*4b00" \ |
| 5901 | -c "mbedtls_pk_verify.*4b00" \ |
| 5902 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5903 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5904 | |
| 5905 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5906 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5907 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5908 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5909 | crt_file=data_files/server5-badsign.crt \ |
| 5910 | key_file=data_files/server5.key" \ |
| 5911 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5912 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5913 | debug_level=1 ec_max_ops=1000" \ |
| 5914 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5915 | -c "x509_verify_cert.*4b00" \ |
| 5916 | -C "mbedtls_pk_verify.*4b00" \ |
| 5917 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5918 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5919 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5920 | -c "! mbedtls_ssl_handshake returned" \ |
| 5921 | -c "X509 - Certificate verification failed" |
| 5922 | |
| 5923 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5924 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5925 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5926 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5927 | crt_file=data_files/server5-badsign.crt \ |
| 5928 | key_file=data_files/server5.key" \ |
| 5929 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5930 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5931 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 5932 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5933 | -c "x509_verify_cert.*4b00" \ |
| 5934 | -c "mbedtls_pk_verify.*4b00" \ |
| 5935 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5936 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5937 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5938 | -C "! mbedtls_ssl_handshake returned" \ |
| 5939 | -C "X509 - Certificate verification failed" |
| 5940 | |
| 5941 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5942 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5943 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5944 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5945 | crt_file=data_files/server5-badsign.crt \ |
| 5946 | key_file=data_files/server5.key" \ |
| 5947 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5948 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5949 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 5950 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5951 | -C "x509_verify_cert.*4b00" \ |
| 5952 | -c "mbedtls_pk_verify.*4b00" \ |
| 5953 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5954 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5955 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5956 | -C "! mbedtls_ssl_handshake returned" \ |
| 5957 | -C "X509 - Certificate verification failed" |
| 5958 | |
| 5959 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5960 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5961 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5962 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5963 | "$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] | 5964 | 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] | 5965 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 5966 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5967 | -c "x509_verify_cert.*4b00" \ |
| 5968 | -c "mbedtls_pk_verify.*4b00" \ |
| 5969 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5970 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5971 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5972 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5973 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5974 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5975 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5976 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5977 | debug_level=1 ec_max_ops=1000" \ |
| 5978 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5979 | -c "x509_verify_cert.*4b00" \ |
| 5980 | -c "mbedtls_pk_verify.*4b00" \ |
| 5981 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5982 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5983 | |
| 5984 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5985 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5986 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5987 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5988 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 5989 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 5990 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5991 | -C "x509_verify_cert.*4b00" \ |
| 5992 | -C "mbedtls_pk_verify.*4b00" \ |
| 5993 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5994 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5995 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5996 | # Tests of asynchronous private key support in SSL |
| 5997 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5998 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5999 | run_test "SSL async private: sign, delay=0" \ |
| 6000 | "$P_SRV \ |
| 6001 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6002 | "$P_CLI" \ |
| 6003 | 0 \ |
| 6004 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6005 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6006 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6007 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6008 | run_test "SSL async private: sign, delay=1" \ |
| 6009 | "$P_SRV \ |
| 6010 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6011 | "$P_CLI" \ |
| 6012 | 0 \ |
| 6013 | -s "Async sign callback: using key slot " \ |
| 6014 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6015 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6016 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6017 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6018 | run_test "SSL async private: sign, delay=2" \ |
| 6019 | "$P_SRV \ |
| 6020 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6021 | "$P_CLI" \ |
| 6022 | 0 \ |
| 6023 | -s "Async sign callback: using key slot " \ |
| 6024 | -U "Async sign callback: using key slot " \ |
| 6025 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6026 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6027 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6028 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6029 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6030 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6031 | run_test "SSL async private: sign, SNI" \ |
| 6032 | "$P_SRV debug_level=3 \ |
| 6033 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6034 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6035 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6036 | "$P_CLI server_name=polarssl.example" \ |
| 6037 | 0 \ |
| 6038 | -s "Async sign callback: using key slot " \ |
| 6039 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6040 | -s "parse ServerName extension" \ |
| 6041 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6042 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6043 | |
| 6044 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6045 | run_test "SSL async private: decrypt, delay=0" \ |
| 6046 | "$P_SRV \ |
| 6047 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6048 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6049 | 0 \ |
| 6050 | -s "Async decrypt callback: using key slot " \ |
| 6051 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6052 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6053 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6054 | run_test "SSL async private: decrypt, delay=1" \ |
| 6055 | "$P_SRV \ |
| 6056 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6057 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6058 | 0 \ |
| 6059 | -s "Async decrypt callback: using key slot " \ |
| 6060 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6061 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6062 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6063 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6064 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6065 | "$P_SRV psk=abc123 \ |
| 6066 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6067 | "$P_CLI psk=abc123 \ |
| 6068 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6069 | 0 \ |
| 6070 | -s "Async decrypt callback: using key slot " \ |
| 6071 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6072 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6073 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6074 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6075 | "$P_SRV psk=abc123 \ |
| 6076 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6077 | "$P_CLI psk=abc123 \ |
| 6078 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6079 | 0 \ |
| 6080 | -s "Async decrypt callback: using key slot " \ |
| 6081 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6082 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6083 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6084 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6085 | run_test "SSL async private: sign callback not present" \ |
| 6086 | "$P_SRV \ |
| 6087 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6088 | "$P_CLI; [ \$? -eq 1 ] && |
| 6089 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6090 | 0 \ |
| 6091 | -S "Async sign callback" \ |
| 6092 | -s "! mbedtls_ssl_handshake returned" \ |
| 6093 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6094 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6095 | -s "Successful connection" |
| 6096 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6097 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6098 | run_test "SSL async private: decrypt callback not present" \ |
| 6099 | "$P_SRV debug_level=1 \ |
| 6100 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6101 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6102 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6103 | 0 \ |
| 6104 | -S "Async decrypt callback" \ |
| 6105 | -s "! mbedtls_ssl_handshake returned" \ |
| 6106 | -s "got no RSA private key" \ |
| 6107 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6108 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6109 | |
| 6110 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6111 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6112 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6113 | "$P_SRV \ |
| 6114 | async_operations=s async_private_delay1=1 \ |
| 6115 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6116 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6117 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6118 | 0 \ |
| 6119 | -s "Async sign callback: using key slot 0," \ |
| 6120 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6121 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6122 | |
| 6123 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6124 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6125 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6126 | "$P_SRV \ |
| 6127 | async_operations=s async_private_delay2=1 \ |
| 6128 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6129 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6130 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6131 | 0 \ |
| 6132 | -s "Async sign callback: using key slot 0," \ |
| 6133 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6134 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6135 | |
| 6136 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6137 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6138 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6139 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6140 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6141 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6142 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6143 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6144 | 0 \ |
| 6145 | -s "Async sign callback: using key slot 1," \ |
| 6146 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6147 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6148 | |
| 6149 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6150 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6151 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6152 | "$P_SRV \ |
| 6153 | async_operations=s async_private_delay1=1 \ |
| 6154 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6155 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6156 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6157 | 0 \ |
| 6158 | -s "Async sign callback: no key matches this certificate." |
| 6159 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6160 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6161 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6162 | "$P_SRV \ |
| 6163 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6164 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6165 | "$P_CLI" \ |
| 6166 | 1 \ |
| 6167 | -s "Async sign callback: injected error" \ |
| 6168 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6169 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6170 | -s "! mbedtls_ssl_handshake returned" |
| 6171 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6172 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6173 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6174 | "$P_SRV \ |
| 6175 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6176 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6177 | "$P_CLI" \ |
| 6178 | 1 \ |
| 6179 | -s "Async sign callback: using key slot " \ |
| 6180 | -S "Async resume" \ |
| 6181 | -s "Async cancel" |
| 6182 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6183 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6184 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6185 | "$P_SRV \ |
| 6186 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6187 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6188 | "$P_CLI" \ |
| 6189 | 1 \ |
| 6190 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6191 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6192 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6193 | -s "! mbedtls_ssl_handshake returned" |
| 6194 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6195 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6196 | run_test "SSL async private: decrypt, error in start" \ |
| 6197 | "$P_SRV \ |
| 6198 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6199 | async_private_error=1" \ |
| 6200 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6201 | 1 \ |
| 6202 | -s "Async decrypt callback: injected error" \ |
| 6203 | -S "Async resume" \ |
| 6204 | -S "Async cancel" \ |
| 6205 | -s "! mbedtls_ssl_handshake returned" |
| 6206 | |
| 6207 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6208 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6209 | "$P_SRV \ |
| 6210 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6211 | async_private_error=2" \ |
| 6212 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6213 | 1 \ |
| 6214 | -s "Async decrypt callback: using key slot " \ |
| 6215 | -S "Async resume" \ |
| 6216 | -s "Async cancel" |
| 6217 | |
| 6218 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6219 | run_test "SSL async private: decrypt, error in resume" \ |
| 6220 | "$P_SRV \ |
| 6221 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6222 | async_private_error=3" \ |
| 6223 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6224 | 1 \ |
| 6225 | -s "Async decrypt callback: using key slot " \ |
| 6226 | -s "Async resume callback: decrypt done but injected error" \ |
| 6227 | -S "Async cancel" \ |
| 6228 | -s "! mbedtls_ssl_handshake returned" |
| 6229 | |
| 6230 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6231 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6232 | "$P_SRV \ |
| 6233 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6234 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6235 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6236 | 0 \ |
| 6237 | -s "Async cancel" \ |
| 6238 | -s "! mbedtls_ssl_handshake returned" \ |
| 6239 | -s "Async resume" \ |
| 6240 | -s "Successful connection" |
| 6241 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6242 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6243 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6244 | "$P_SRV \ |
| 6245 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6246 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6247 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6248 | 0 \ |
| 6249 | -s "! mbedtls_ssl_handshake returned" \ |
| 6250 | -s "Async resume" \ |
| 6251 | -s "Successful connection" |
| 6252 | |
| 6253 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6254 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6255 | 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] | 6256 | "$P_SRV \ |
| 6257 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6258 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6259 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6260 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6261 | [ \$? -eq 1 ] && |
| 6262 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6263 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6264 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6265 | -S "Async resume" \ |
| 6266 | -s "Async cancel" \ |
| 6267 | -s "! mbedtls_ssl_handshake returned" \ |
| 6268 | -s "Async sign callback: no key matches this certificate." \ |
| 6269 | -s "Successful connection" |
| 6270 | |
| 6271 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6272 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6273 | 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] | 6274 | "$P_SRV \ |
| 6275 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6276 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6277 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6278 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6279 | [ \$? -eq 1 ] && |
| 6280 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6281 | 0 \ |
| 6282 | -s "Async resume" \ |
| 6283 | -s "! mbedtls_ssl_handshake returned" \ |
| 6284 | -s "Async sign callback: no key matches this certificate." \ |
| 6285 | -s "Successful connection" |
| 6286 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6287 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6288 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6289 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6290 | "$P_SRV \ |
| 6291 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6292 | exchanges=2 renegotiation=1" \ |
| 6293 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6294 | 0 \ |
| 6295 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6296 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6297 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6298 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6299 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6300 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6301 | "$P_SRV \ |
| 6302 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6303 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6304 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6305 | 0 \ |
| 6306 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6307 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6308 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6309 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6310 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6311 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6312 | "$P_SRV \ |
| 6313 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6314 | exchanges=2 renegotiation=1" \ |
| 6315 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6316 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6317 | 0 \ |
| 6318 | -s "Async decrypt callback: using key slot " \ |
| 6319 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6320 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6321 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6322 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6323 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6324 | "$P_SRV \ |
| 6325 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6326 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6327 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6328 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6329 | 0 \ |
| 6330 | -s "Async decrypt callback: using key slot " \ |
| 6331 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6332 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6333 | # Tests for ECC extensions (rfc 4492) |
| 6334 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6335 | requires_config_enabled MBEDTLS_AES_C |
| 6336 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6337 | requires_config_enabled MBEDTLS_SHA256_C |
| 6338 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6339 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6340 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6341 | "$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] | 6342 | 0 \ |
| 6343 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6344 | -C "client hello, adding supported_point_formats extension" \ |
| 6345 | -S "found supported elliptic curves extension" \ |
| 6346 | -S "found supported point formats extension" |
| 6347 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6348 | requires_config_enabled MBEDTLS_AES_C |
| 6349 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6350 | requires_config_enabled MBEDTLS_SHA256_C |
| 6351 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6352 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6353 | "$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] | 6354 | "$P_CLI debug_level=3" \ |
| 6355 | 0 \ |
| 6356 | -C "found supported_point_formats extension" \ |
| 6357 | -S "server hello, supported_point_formats extension" |
| 6358 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6359 | requires_config_enabled MBEDTLS_AES_C |
| 6360 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6361 | requires_config_enabled MBEDTLS_SHA256_C |
| 6362 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6363 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6364 | "$P_SRV debug_level=3" \ |
| 6365 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6366 | 0 \ |
| 6367 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6368 | -c "client hello, adding supported_point_formats extension" \ |
| 6369 | -s "found supported elliptic curves extension" \ |
| 6370 | -s "found supported point formats extension" |
| 6371 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6372 | requires_config_enabled MBEDTLS_AES_C |
| 6373 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6374 | requires_config_enabled MBEDTLS_SHA256_C |
| 6375 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6376 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6377 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6378 | "$P_CLI debug_level=3" \ |
| 6379 | 0 \ |
| 6380 | -c "found supported_point_formats extension" \ |
| 6381 | -s "server hello, supported_point_formats extension" |
| 6382 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6383 | # Tests for DTLS HelloVerifyRequest |
| 6384 | |
| 6385 | run_test "DTLS cookie: enabled" \ |
| 6386 | "$P_SRV dtls=1 debug_level=2" \ |
| 6387 | "$P_CLI dtls=1 debug_level=2" \ |
| 6388 | 0 \ |
| 6389 | -s "cookie verification failed" \ |
| 6390 | -s "cookie verification passed" \ |
| 6391 | -S "cookie verification skipped" \ |
| 6392 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6393 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6394 | -S "SSL - The requested feature is not available" |
| 6395 | |
| 6396 | run_test "DTLS cookie: disabled" \ |
| 6397 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6398 | "$P_CLI dtls=1 debug_level=2" \ |
| 6399 | 0 \ |
| 6400 | -S "cookie verification failed" \ |
| 6401 | -S "cookie verification passed" \ |
| 6402 | -s "cookie verification skipped" \ |
| 6403 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6404 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6405 | -S "SSL - The requested feature is not available" |
| 6406 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6407 | run_test "DTLS cookie: default (failing)" \ |
| 6408 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6409 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6410 | 1 \ |
| 6411 | -s "cookie verification failed" \ |
| 6412 | -S "cookie verification passed" \ |
| 6413 | -S "cookie verification skipped" \ |
| 6414 | -C "received hello verify request" \ |
| 6415 | -S "hello verification requested" \ |
| 6416 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6417 | |
| 6418 | requires_ipv6 |
| 6419 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6420 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6421 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6422 | 0 \ |
| 6423 | -s "cookie verification failed" \ |
| 6424 | -s "cookie verification passed" \ |
| 6425 | -S "cookie verification skipped" \ |
| 6426 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6427 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6428 | -S "SSL - The requested feature is not available" |
| 6429 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6430 | run_test "DTLS cookie: enabled, nbio" \ |
| 6431 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6432 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6433 | 0 \ |
| 6434 | -s "cookie verification failed" \ |
| 6435 | -s "cookie verification passed" \ |
| 6436 | -S "cookie verification skipped" \ |
| 6437 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6438 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6439 | -S "SSL - The requested feature is not available" |
| 6440 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6441 | # Tests for client reconnecting from the same port with DTLS |
| 6442 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6443 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6444 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6445 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6446 | "$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] | 6447 | 0 \ |
| 6448 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6449 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6450 | -S "Client initiated reconnection from same port" |
| 6451 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6452 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6453 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6454 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6455 | "$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] | 6456 | 0 \ |
| 6457 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6458 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6459 | -s "Client initiated reconnection from same port" |
| 6460 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6461 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6462 | 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] | 6463 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6464 | "$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] | 6465 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6466 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6467 | -s "Client initiated reconnection from same port" |
| 6468 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6469 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6470 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6471 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6472 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6473 | 0 \ |
| 6474 | -S "The operation timed out" \ |
| 6475 | -s "Client initiated reconnection from same port" |
| 6476 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6477 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6478 | "$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] | 6479 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6480 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6481 | -s "The operation timed out" \ |
| 6482 | -S "Client initiated reconnection from same port" |
| 6483 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6484 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6485 | -p "$P_PXY inject_clihlo=1" \ |
| 6486 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6487 | "$P_CLI dtls=1 exchanges=2" \ |
| 6488 | 0 \ |
| 6489 | -s "possible client reconnect from the same port" \ |
| 6490 | -S "Client initiated reconnection from same port" |
| 6491 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6492 | # Tests for various cases of client authentication with DTLS |
| 6493 | # (focused on handshake flows and message parsing) |
| 6494 | |
| 6495 | run_test "DTLS client auth: required" \ |
| 6496 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6497 | "$P_CLI dtls=1" \ |
| 6498 | 0 \ |
| 6499 | -s "Verifying peer X.509 certificate... ok" |
| 6500 | |
| 6501 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6502 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6503 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6504 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6505 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6506 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6507 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6508 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6509 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6510 | 0 \ |
| 6511 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6512 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6513 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6514 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6515 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6516 | "$P_CLI dtls=1 psk=abc124" \ |
| 6517 | 1 \ |
| 6518 | -s "SSL - Verification of the message MAC failed" \ |
| 6519 | -c "SSL - A fatal alert message was received from our peer" |
| 6520 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6521 | # Tests for receiving fragmented handshake messages with DTLS |
| 6522 | |
| 6523 | requires_gnutls |
| 6524 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6525 | "$G_SRV -u --mtu 2048 -a" \ |
| 6526 | "$P_CLI dtls=1 debug_level=2" \ |
| 6527 | 0 \ |
| 6528 | -C "found fragmented DTLS handshake message" \ |
| 6529 | -C "error" |
| 6530 | |
| 6531 | requires_gnutls |
| 6532 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6533 | "$G_SRV -u --mtu 512" \ |
| 6534 | "$P_CLI dtls=1 debug_level=2" \ |
| 6535 | 0 \ |
| 6536 | -c "found fragmented DTLS handshake message" \ |
| 6537 | -C "error" |
| 6538 | |
| 6539 | requires_gnutls |
| 6540 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6541 | "$G_SRV -u --mtu 128" \ |
| 6542 | "$P_CLI dtls=1 debug_level=2" \ |
| 6543 | 0 \ |
| 6544 | -c "found fragmented DTLS handshake message" \ |
| 6545 | -C "error" |
| 6546 | |
| 6547 | requires_gnutls |
| 6548 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6549 | "$G_SRV -u --mtu 128" \ |
| 6550 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6551 | 0 \ |
| 6552 | -c "found fragmented DTLS handshake message" \ |
| 6553 | -C "error" |
| 6554 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6555 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6556 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6557 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6558 | "$G_SRV -u --mtu 256" \ |
| 6559 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6560 | 0 \ |
| 6561 | -c "found fragmented DTLS handshake message" \ |
| 6562 | -c "client hello, adding renegotiation extension" \ |
| 6563 | -c "found renegotiation extension" \ |
| 6564 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6565 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6566 | -C "error" \ |
| 6567 | -s "Extra-header:" |
| 6568 | |
| 6569 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6570 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6571 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6572 | "$G_SRV -u --mtu 256" \ |
| 6573 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6574 | 0 \ |
| 6575 | -c "found fragmented DTLS handshake message" \ |
| 6576 | -c "client hello, adding renegotiation extension" \ |
| 6577 | -c "found renegotiation extension" \ |
| 6578 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6579 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6580 | -C "error" \ |
| 6581 | -s "Extra-header:" |
| 6582 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6583 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6584 | "$O_SRV -dtls -mtu 2048" \ |
| 6585 | "$P_CLI dtls=1 debug_level=2" \ |
| 6586 | 0 \ |
| 6587 | -C "found fragmented DTLS handshake message" \ |
| 6588 | -C "error" |
| 6589 | |
| 6590 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6591 | "$O_SRV -dtls -mtu 768" \ |
| 6592 | "$P_CLI dtls=1 debug_level=2" \ |
| 6593 | 0 \ |
| 6594 | -c "found fragmented DTLS handshake message" \ |
| 6595 | -C "error" |
| 6596 | |
| 6597 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6598 | "$O_SRV -dtls -mtu 256" \ |
| 6599 | "$P_CLI dtls=1 debug_level=2" \ |
| 6600 | 0 \ |
| 6601 | -c "found fragmented DTLS handshake message" \ |
| 6602 | -C "error" |
| 6603 | |
| 6604 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6605 | "$O_SRV -dtls -mtu 256" \ |
| 6606 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6607 | 0 \ |
| 6608 | -c "found fragmented DTLS handshake message" \ |
| 6609 | -C "error" |
| 6610 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6611 | # Tests for sending fragmented handshake messages with DTLS |
| 6612 | # |
| 6613 | # Use client auth when we need the client to send large messages, |
| 6614 | # and use large cert chains on both sides too (the long chains we have all use |
| 6615 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6616 | # Sizes reached (UDP payload): |
| 6617 | # - 2037B for server certificate |
| 6618 | # - 1542B for client certificate |
| 6619 | # - 1013B for newsessionticket |
| 6620 | # - all others below 512B |
| 6621 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6622 | |
| 6623 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6624 | requires_config_enabled MBEDTLS_RSA_C |
| 6625 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6626 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6627 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6628 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6629 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6630 | crt_file=data_files/server7_int-ca.crt \ |
| 6631 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6632 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6633 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6634 | "$P_CLI dtls=1 debug_level=2 \ |
| 6635 | crt_file=data_files/server8_int-ca2.crt \ |
| 6636 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6637 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6638 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6639 | 0 \ |
| 6640 | -S "found fragmented DTLS handshake message" \ |
| 6641 | -C "found fragmented DTLS handshake message" \ |
| 6642 | -C "error" |
| 6643 | |
| 6644 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6645 | requires_config_enabled MBEDTLS_RSA_C |
| 6646 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6647 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6648 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6649 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6650 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6651 | crt_file=data_files/server7_int-ca.crt \ |
| 6652 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6653 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6654 | max_frag_len=1024" \ |
| 6655 | "$P_CLI dtls=1 debug_level=2 \ |
| 6656 | crt_file=data_files/server8_int-ca2.crt \ |
| 6657 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6658 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6659 | max_frag_len=2048" \ |
| 6660 | 0 \ |
| 6661 | -S "found fragmented DTLS handshake message" \ |
| 6662 | -c "found fragmented DTLS handshake message" \ |
| 6663 | -C "error" |
| 6664 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6665 | # With the MFL extension, the server has no way of forcing |
| 6666 | # the client to not exceed a certain MTU; hence, the following |
| 6667 | # test can't be replicated with an MTU proxy such as the one |
| 6668 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6669 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6670 | requires_config_enabled MBEDTLS_RSA_C |
| 6671 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6672 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6673 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6674 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6675 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6676 | crt_file=data_files/server7_int-ca.crt \ |
| 6677 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6678 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6679 | max_frag_len=512" \ |
| 6680 | "$P_CLI dtls=1 debug_level=2 \ |
| 6681 | crt_file=data_files/server8_int-ca2.crt \ |
| 6682 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6683 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6684 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6685 | 0 \ |
| 6686 | -S "found fragmented DTLS handshake message" \ |
| 6687 | -c "found fragmented DTLS handshake message" \ |
| 6688 | -C "error" |
| 6689 | |
| 6690 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6691 | requires_config_enabled MBEDTLS_RSA_C |
| 6692 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6693 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6694 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6695 | 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] | 6696 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6697 | crt_file=data_files/server7_int-ca.crt \ |
| 6698 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6699 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6700 | max_frag_len=2048" \ |
| 6701 | "$P_CLI dtls=1 debug_level=2 \ |
| 6702 | crt_file=data_files/server8_int-ca2.crt \ |
| 6703 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6704 | hs_timeout=2500-60000 \ |
| 6705 | max_frag_len=1024" \ |
| 6706 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6707 | -S "found fragmented DTLS handshake message" \ |
| 6708 | -c "found fragmented DTLS handshake message" \ |
| 6709 | -C "error" |
| 6710 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6711 | # While not required by the standard defining the MFL extension |
| 6712 | # (according to which it only applies to records, not to datagrams), |
| 6713 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6714 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6715 | # to the peer. |
| 6716 | # The next test checks that no datagrams significantly larger than the |
| 6717 | # negotiated MFL are sent. |
| 6718 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6719 | requires_config_enabled MBEDTLS_RSA_C |
| 6720 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6721 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6722 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6723 | 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] | 6724 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6725 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6726 | crt_file=data_files/server7_int-ca.crt \ |
| 6727 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6728 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6729 | max_frag_len=2048" \ |
| 6730 | "$P_CLI dtls=1 debug_level=2 \ |
| 6731 | crt_file=data_files/server8_int-ca2.crt \ |
| 6732 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6733 | hs_timeout=2500-60000 \ |
| 6734 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6735 | 0 \ |
| 6736 | -S "found fragmented DTLS handshake message" \ |
| 6737 | -c "found fragmented DTLS handshake message" \ |
| 6738 | -C "error" |
| 6739 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6740 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6741 | requires_config_enabled MBEDTLS_RSA_C |
| 6742 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6743 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6744 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6745 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6746 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6747 | crt_file=data_files/server7_int-ca.crt \ |
| 6748 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6749 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6750 | max_frag_len=2048" \ |
| 6751 | "$P_CLI dtls=1 debug_level=2 \ |
| 6752 | crt_file=data_files/server8_int-ca2.crt \ |
| 6753 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6754 | hs_timeout=2500-60000 \ |
| 6755 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6756 | 0 \ |
| 6757 | -s "found fragmented DTLS handshake message" \ |
| 6758 | -c "found fragmented DTLS handshake message" \ |
| 6759 | -C "error" |
| 6760 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6761 | # While not required by the standard defining the MFL extension |
| 6762 | # (according to which it only applies to records, not to datagrams), |
| 6763 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6764 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6765 | # to the peer. |
| 6766 | # The next test checks that no datagrams significantly larger than the |
| 6767 | # negotiated MFL are sent. |
| 6768 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6769 | requires_config_enabled MBEDTLS_RSA_C |
| 6770 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6771 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6772 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6773 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6774 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6775 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6776 | crt_file=data_files/server7_int-ca.crt \ |
| 6777 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6778 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6779 | max_frag_len=2048" \ |
| 6780 | "$P_CLI dtls=1 debug_level=2 \ |
| 6781 | crt_file=data_files/server8_int-ca2.crt \ |
| 6782 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6783 | hs_timeout=2500-60000 \ |
| 6784 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6785 | 0 \ |
| 6786 | -s "found fragmented DTLS handshake message" \ |
| 6787 | -c "found fragmented DTLS handshake message" \ |
| 6788 | -C "error" |
| 6789 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6790 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6791 | requires_config_enabled MBEDTLS_RSA_C |
| 6792 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6793 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6794 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6795 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6796 | crt_file=data_files/server7_int-ca.crt \ |
| 6797 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6798 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6799 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6800 | "$P_CLI dtls=1 debug_level=2 \ |
| 6801 | crt_file=data_files/server8_int-ca2.crt \ |
| 6802 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6803 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6804 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6805 | 0 \ |
| 6806 | -S "found fragmented DTLS handshake message" \ |
| 6807 | -C "found fragmented DTLS handshake message" \ |
| 6808 | -C "error" |
| 6809 | |
| 6810 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6811 | requires_config_enabled MBEDTLS_RSA_C |
| 6812 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6813 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6814 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6815 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6816 | crt_file=data_files/server7_int-ca.crt \ |
| 6817 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6818 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6819 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6820 | "$P_CLI dtls=1 debug_level=2 \ |
| 6821 | crt_file=data_files/server8_int-ca2.crt \ |
| 6822 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6823 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6824 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6825 | 0 \ |
| 6826 | -s "found fragmented DTLS handshake message" \ |
| 6827 | -C "found fragmented DTLS handshake message" \ |
| 6828 | -C "error" |
| 6829 | |
| 6830 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6831 | requires_config_enabled MBEDTLS_RSA_C |
| 6832 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6833 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6834 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6835 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6836 | crt_file=data_files/server7_int-ca.crt \ |
| 6837 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6838 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6839 | mtu=512" \ |
| 6840 | "$P_CLI dtls=1 debug_level=2 \ |
| 6841 | crt_file=data_files/server8_int-ca2.crt \ |
| 6842 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6843 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6844 | mtu=2048" \ |
| 6845 | 0 \ |
| 6846 | -S "found fragmented DTLS handshake message" \ |
| 6847 | -c "found fragmented DTLS handshake message" \ |
| 6848 | -C "error" |
| 6849 | |
| 6850 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6851 | requires_config_enabled MBEDTLS_RSA_C |
| 6852 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6853 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6854 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6855 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6856 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6857 | crt_file=data_files/server7_int-ca.crt \ |
| 6858 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6859 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6860 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6861 | "$P_CLI dtls=1 debug_level=2 \ |
| 6862 | crt_file=data_files/server8_int-ca2.crt \ |
| 6863 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6864 | hs_timeout=2500-60000 \ |
| 6865 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6866 | 0 \ |
| 6867 | -s "found fragmented DTLS handshake message" \ |
| 6868 | -c "found fragmented DTLS handshake message" \ |
| 6869 | -C "error" |
| 6870 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6871 | # 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] | 6872 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6873 | requires_config_enabled MBEDTLS_RSA_C |
| 6874 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6875 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6876 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6877 | requires_config_enabled MBEDTLS_AES_C |
| 6878 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6879 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6880 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6881 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6882 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6883 | crt_file=data_files/server7_int-ca.crt \ |
| 6884 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6885 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6886 | mtu=512" \ |
| 6887 | "$P_CLI dtls=1 debug_level=2 \ |
| 6888 | crt_file=data_files/server8_int-ca2.crt \ |
| 6889 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6890 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6891 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6892 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6893 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6894 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6895 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6896 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6897 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6898 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6899 | # 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] | 6900 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 6901 | # retransmissions, but in some cases (like both the server and client using |
| 6902 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 6903 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 6904 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6905 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6906 | requires_config_enabled MBEDTLS_RSA_C |
| 6907 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6908 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6909 | requires_config_enabled MBEDTLS_AES_C |
| 6910 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6911 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 6912 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6913 | -p "$P_PXY mtu=508" \ |
| 6914 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6915 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6916 | key_file=data_files/server7.key \ |
| 6917 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6918 | "$P_CLI dtls=1 debug_level=2 \ |
| 6919 | crt_file=data_files/server8_int-ca2.crt \ |
| 6920 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6921 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6922 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6923 | 0 \ |
| 6924 | -s "found fragmented DTLS handshake message" \ |
| 6925 | -c "found fragmented DTLS handshake message" \ |
| 6926 | -C "error" |
| 6927 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6928 | # 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] | 6929 | only_with_valgrind |
| 6930 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6931 | requires_config_enabled MBEDTLS_RSA_C |
| 6932 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6933 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6934 | requires_config_enabled MBEDTLS_AES_C |
| 6935 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6936 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 6937 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6938 | -p "$P_PXY mtu=508" \ |
| 6939 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6940 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6941 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6942 | hs_timeout=250-10000" \ |
| 6943 | "$P_CLI dtls=1 debug_level=2 \ |
| 6944 | crt_file=data_files/server8_int-ca2.crt \ |
| 6945 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6946 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6947 | hs_timeout=250-10000" \ |
| 6948 | 0 \ |
| 6949 | -s "found fragmented DTLS handshake message" \ |
| 6950 | -c "found fragmented DTLS handshake message" \ |
| 6951 | -C "error" |
| 6952 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6953 | # 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] | 6954 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6955 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6956 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6957 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6958 | requires_config_enabled MBEDTLS_RSA_C |
| 6959 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6960 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6961 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6962 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6963 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6964 | crt_file=data_files/server7_int-ca.crt \ |
| 6965 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6966 | hs_timeout=10000-60000 \ |
| 6967 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6968 | "$P_CLI dtls=1 debug_level=2 \ |
| 6969 | crt_file=data_files/server8_int-ca2.crt \ |
| 6970 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6971 | hs_timeout=10000-60000 \ |
| 6972 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6973 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6974 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6975 | -s "found fragmented DTLS handshake message" \ |
| 6976 | -c "found fragmented DTLS handshake message" \ |
| 6977 | -C "error" |
| 6978 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6979 | # 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] | 6980 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 6981 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6982 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6983 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6984 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6985 | requires_config_enabled MBEDTLS_RSA_C |
| 6986 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6987 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6988 | requires_config_enabled MBEDTLS_AES_C |
| 6989 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6990 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6991 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6992 | -p "$P_PXY mtu=512" \ |
| 6993 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6994 | crt_file=data_files/server7_int-ca.crt \ |
| 6995 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6996 | hs_timeout=10000-60000 \ |
| 6997 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6998 | "$P_CLI dtls=1 debug_level=2 \ |
| 6999 | crt_file=data_files/server8_int-ca2.crt \ |
| 7000 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7001 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7002 | hs_timeout=10000-60000 \ |
| 7003 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7004 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7005 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7006 | -s "found fragmented DTLS handshake message" \ |
| 7007 | -c "found fragmented DTLS handshake message" \ |
| 7008 | -C "error" |
| 7009 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7010 | not_with_valgrind # spurious autoreduction due to timeout |
| 7011 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7012 | requires_config_enabled MBEDTLS_RSA_C |
| 7013 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7014 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7015 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7016 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7017 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7018 | crt_file=data_files/server7_int-ca.crt \ |
| 7019 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7020 | hs_timeout=10000-60000 \ |
| 7021 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7022 | "$P_CLI dtls=1 debug_level=2 \ |
| 7023 | crt_file=data_files/server8_int-ca2.crt \ |
| 7024 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7025 | hs_timeout=10000-60000 \ |
| 7026 | mtu=1024 nbio=2" \ |
| 7027 | 0 \ |
| 7028 | -S "autoreduction" \ |
| 7029 | -s "found fragmented DTLS handshake message" \ |
| 7030 | -c "found fragmented DTLS handshake message" \ |
| 7031 | -C "error" |
| 7032 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7033 | # 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] | 7034 | not_with_valgrind # spurious autoreduction due to timeout |
| 7035 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7036 | requires_config_enabled MBEDTLS_RSA_C |
| 7037 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7038 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7039 | requires_config_enabled MBEDTLS_AES_C |
| 7040 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7041 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7042 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7043 | -p "$P_PXY mtu=512" \ |
| 7044 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7045 | crt_file=data_files/server7_int-ca.crt \ |
| 7046 | key_file=data_files/server7.key \ |
| 7047 | hs_timeout=10000-60000 \ |
| 7048 | mtu=512 nbio=2" \ |
| 7049 | "$P_CLI dtls=1 debug_level=2 \ |
| 7050 | crt_file=data_files/server8_int-ca2.crt \ |
| 7051 | key_file=data_files/server8.key \ |
| 7052 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7053 | hs_timeout=10000-60000 \ |
| 7054 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7055 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7056 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7057 | -s "found fragmented DTLS handshake message" \ |
| 7058 | -c "found fragmented DTLS handshake message" \ |
| 7059 | -C "error" |
| 7060 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7061 | # Forcing ciphersuite for this test to fit the MTU of 1450 with full config. |
Hanno Becker | b841b4f | 2018-08-28 10:25:51 +0100 | [diff] [blame] | 7062 | # This ensures things still work after session_reset(). |
| 7063 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7064 | # Since we don't support reading fragmented ClientHello yet, |
| 7065 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7066 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7067 | # An autoreduction on the client-side might happen if the server is |
| 7068 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7069 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7070 | # resumed listening, which would result in a spurious autoreduction. |
| 7071 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7072 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7073 | requires_config_enabled MBEDTLS_RSA_C |
| 7074 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7075 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7076 | requires_config_enabled MBEDTLS_AES_C |
| 7077 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7078 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7079 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7080 | -p "$P_PXY mtu=1450" \ |
| 7081 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7082 | crt_file=data_files/server7_int-ca.crt \ |
| 7083 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7084 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7085 | mtu=1450" \ |
| 7086 | "$P_CLI dtls=1 debug_level=2 \ |
| 7087 | crt_file=data_files/server8_int-ca2.crt \ |
| 7088 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7089 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7090 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7091 | 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] | 7092 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7093 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7094 | -s "found fragmented DTLS handshake message" \ |
| 7095 | -c "found fragmented DTLS handshake message" \ |
| 7096 | -C "error" |
| 7097 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7098 | # An autoreduction on the client-side might happen if the server is |
| 7099 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7100 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7101 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7102 | requires_config_enabled MBEDTLS_RSA_C |
| 7103 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7104 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7105 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7106 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7107 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7108 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7109 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7110 | -p "$P_PXY mtu=512" \ |
| 7111 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7112 | crt_file=data_files/server7_int-ca.crt \ |
| 7113 | key_file=data_files/server7.key \ |
| 7114 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7115 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7116 | mtu=512" \ |
| 7117 | "$P_CLI dtls=1 debug_level=2 \ |
| 7118 | crt_file=data_files/server8_int-ca2.crt \ |
| 7119 | key_file=data_files/server8.key \ |
| 7120 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7121 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7122 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7123 | mtu=512" \ |
| 7124 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7125 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7126 | -s "found fragmented DTLS handshake message" \ |
| 7127 | -c "found fragmented DTLS handshake message" \ |
| 7128 | -C "error" |
| 7129 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7130 | # An autoreduction on the client-side might happen if the server is |
| 7131 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7132 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7133 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7134 | requires_config_enabled MBEDTLS_RSA_C |
| 7135 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7136 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7137 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7138 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7139 | requires_config_enabled MBEDTLS_AES_C |
| 7140 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7141 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7142 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7143 | -p "$P_PXY mtu=512" \ |
| 7144 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7145 | crt_file=data_files/server7_int-ca.crt \ |
| 7146 | key_file=data_files/server7.key \ |
| 7147 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7148 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7149 | mtu=512" \ |
| 7150 | "$P_CLI dtls=1 debug_level=2 \ |
| 7151 | crt_file=data_files/server8_int-ca2.crt \ |
| 7152 | key_file=data_files/server8.key \ |
| 7153 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7154 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7155 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7156 | mtu=512" \ |
| 7157 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7158 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7159 | -s "found fragmented DTLS handshake message" \ |
| 7160 | -c "found fragmented DTLS handshake message" \ |
| 7161 | -C "error" |
| 7162 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7163 | # An autoreduction on the client-side might happen if the server is |
| 7164 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7165 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7166 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7167 | requires_config_enabled MBEDTLS_RSA_C |
| 7168 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7169 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7170 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7171 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7172 | requires_config_enabled MBEDTLS_AES_C |
| 7173 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7174 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7175 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7176 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7177 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7178 | crt_file=data_files/server7_int-ca.crt \ |
| 7179 | key_file=data_files/server7.key \ |
| 7180 | exchanges=2 renegotiation=1 \ |
| 7181 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7182 | hs_timeout=10000-60000 \ |
| 7183 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7184 | "$P_CLI dtls=1 debug_level=2 \ |
| 7185 | crt_file=data_files/server8_int-ca2.crt \ |
| 7186 | key_file=data_files/server8.key \ |
| 7187 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7188 | hs_timeout=10000-60000 \ |
| 7189 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7190 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7191 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7192 | -s "found fragmented DTLS handshake message" \ |
| 7193 | -c "found fragmented DTLS handshake message" \ |
| 7194 | -C "error" |
| 7195 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7196 | # An autoreduction on the client-side might happen if the server is |
| 7197 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7198 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7199 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7200 | requires_config_enabled MBEDTLS_RSA_C |
| 7201 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7202 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7203 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7204 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7205 | requires_config_enabled MBEDTLS_AES_C |
| 7206 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7207 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7208 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7209 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7210 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7211 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7212 | crt_file=data_files/server7_int-ca.crt \ |
| 7213 | key_file=data_files/server7.key \ |
| 7214 | exchanges=2 renegotiation=1 \ |
| 7215 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7216 | hs_timeout=10000-60000 \ |
| 7217 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7218 | "$P_CLI dtls=1 debug_level=2 \ |
| 7219 | crt_file=data_files/server8_int-ca2.crt \ |
| 7220 | key_file=data_files/server8.key \ |
| 7221 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7222 | hs_timeout=10000-60000 \ |
| 7223 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7224 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7225 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7226 | -s "found fragmented DTLS handshake message" \ |
| 7227 | -c "found fragmented DTLS handshake message" \ |
| 7228 | -C "error" |
| 7229 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7230 | # An autoreduction on the client-side might happen if the server is |
| 7231 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7232 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7233 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7234 | requires_config_enabled MBEDTLS_RSA_C |
| 7235 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7236 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7237 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7238 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7239 | requires_config_enabled MBEDTLS_AES_C |
| 7240 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7241 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7242 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7243 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7244 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7245 | crt_file=data_files/server7_int-ca.crt \ |
| 7246 | key_file=data_files/server7.key \ |
| 7247 | exchanges=2 renegotiation=1 \ |
| 7248 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7249 | hs_timeout=10000-60000 \ |
| 7250 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7251 | "$P_CLI dtls=1 debug_level=2 \ |
| 7252 | crt_file=data_files/server8_int-ca2.crt \ |
| 7253 | key_file=data_files/server8.key \ |
| 7254 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7255 | hs_timeout=10000-60000 \ |
| 7256 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7257 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7258 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7259 | -s "found fragmented DTLS handshake message" \ |
| 7260 | -c "found fragmented DTLS handshake message" \ |
| 7261 | -C "error" |
| 7262 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7263 | # 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] | 7264 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7265 | requires_config_enabled MBEDTLS_RSA_C |
| 7266 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7267 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7268 | requires_config_enabled MBEDTLS_AES_C |
| 7269 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7270 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7271 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7272 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7273 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7274 | "$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] | 7275 | crt_file=data_files/server7_int-ca.crt \ |
| 7276 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7277 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7278 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7279 | crt_file=data_files/server8_int-ca2.crt \ |
| 7280 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7281 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7282 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7283 | 0 \ |
| 7284 | -s "found fragmented DTLS handshake message" \ |
| 7285 | -c "found fragmented DTLS handshake message" \ |
| 7286 | -C "error" |
| 7287 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7288 | # 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] | 7289 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7290 | requires_config_enabled MBEDTLS_RSA_C |
| 7291 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7292 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7293 | requires_config_enabled MBEDTLS_AES_C |
| 7294 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7295 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7296 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7297 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7298 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7299 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7300 | crt_file=data_files/server7_int-ca.crt \ |
| 7301 | key_file=data_files/server7.key \ |
| 7302 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7303 | "$P_CLI dtls=1 debug_level=2 \ |
| 7304 | crt_file=data_files/server8_int-ca2.crt \ |
| 7305 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7306 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7307 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7308 | 0 \ |
| 7309 | -s "found fragmented DTLS handshake message" \ |
| 7310 | -c "found fragmented DTLS handshake message" \ |
| 7311 | -C "error" |
| 7312 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7313 | # interop tests for DTLS fragmentating with reliable connection |
| 7314 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7315 | # here and below we just want to test that the we fragment in a way that |
| 7316 | # pleases other implementations, so we don't need the peer to fragment |
| 7317 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7318 | requires_config_enabled MBEDTLS_RSA_C |
| 7319 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7320 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7321 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7322 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7323 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7324 | "$G_SRV -u" \ |
| 7325 | "$P_CLI dtls=1 debug_level=2 \ |
| 7326 | crt_file=data_files/server8_int-ca2.crt \ |
| 7327 | key_file=data_files/server8.key \ |
| 7328 | mtu=512 force_version=dtls1_2" \ |
| 7329 | 0 \ |
| 7330 | -c "fragmenting handshake message" \ |
| 7331 | -C "error" |
| 7332 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7333 | # We use --insecure for the GnuTLS client because it expects |
| 7334 | # the hostname / IP it connects to to be the name used in the |
| 7335 | # certificate obtained from the server. Here, however, it |
| 7336 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7337 | # as the server name in the certificate. This will make the |
| 7338 | # certifiate validation fail, but passing --insecure makes |
| 7339 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7340 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7341 | requires_config_enabled MBEDTLS_RSA_C |
| 7342 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7343 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7344 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7345 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7346 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7347 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7348 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7349 | crt_file=data_files/server7_int-ca.crt \ |
| 7350 | key_file=data_files/server7.key \ |
| 7351 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7352 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7353 | 0 \ |
| 7354 | -s "fragmenting handshake message" |
| 7355 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7356 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7357 | requires_config_enabled MBEDTLS_RSA_C |
| 7358 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7359 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7360 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7361 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7362 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7363 | "$P_CLI dtls=1 debug_level=2 \ |
| 7364 | crt_file=data_files/server8_int-ca2.crt \ |
| 7365 | key_file=data_files/server8.key \ |
| 7366 | mtu=512 force_version=dtls1_2" \ |
| 7367 | 0 \ |
| 7368 | -c "fragmenting handshake message" \ |
| 7369 | -C "error" |
| 7370 | |
| 7371 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7372 | requires_config_enabled MBEDTLS_RSA_C |
| 7373 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7374 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7375 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7376 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7377 | "$P_SRV dtls=1 debug_level=2 \ |
| 7378 | crt_file=data_files/server7_int-ca.crt \ |
| 7379 | key_file=data_files/server7.key \ |
| 7380 | mtu=512 force_version=dtls1_2" \ |
| 7381 | "$O_CLI -dtls1_2" \ |
| 7382 | 0 \ |
| 7383 | -s "fragmenting handshake message" |
| 7384 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7385 | # interop tests for DTLS fragmentating with unreliable connection |
| 7386 | # |
| 7387 | # again we just want to test that the we fragment in a way that |
| 7388 | # pleases other implementations, so we don't need the peer to fragment |
| 7389 | requires_gnutls_next |
| 7390 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7391 | requires_config_enabled MBEDTLS_RSA_C |
| 7392 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7394 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7395 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7396 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7397 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7398 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7399 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7400 | crt_file=data_files/server8_int-ca2.crt \ |
| 7401 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7402 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7403 | 0 \ |
| 7404 | -c "fragmenting handshake message" \ |
| 7405 | -C "error" |
| 7406 | |
| 7407 | requires_gnutls_next |
| 7408 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7409 | requires_config_enabled MBEDTLS_RSA_C |
| 7410 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7412 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7413 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7414 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7415 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7416 | "$P_SRV dtls=1 debug_level=2 \ |
| 7417 | crt_file=data_files/server7_int-ca.crt \ |
| 7418 | key_file=data_files/server7.key \ |
| 7419 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7420 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7421 | 0 \ |
| 7422 | -s "fragmenting handshake message" |
| 7423 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7424 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7425 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7426 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7427 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7428 | ## (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] | 7429 | skip_next_test |
| 7430 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7431 | requires_config_enabled MBEDTLS_RSA_C |
| 7432 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7434 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7435 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7436 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7437 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7438 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7439 | "$P_CLI dtls=1 debug_level=2 \ |
| 7440 | crt_file=data_files/server8_int-ca2.crt \ |
| 7441 | key_file=data_files/server8.key \ |
| 7442 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7443 | 0 \ |
| 7444 | -c "fragmenting handshake message" \ |
| 7445 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7446 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7447 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7448 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7449 | requires_config_enabled MBEDTLS_RSA_C |
| 7450 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7452 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7453 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7454 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7455 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7456 | "$P_SRV dtls=1 debug_level=2 \ |
| 7457 | crt_file=data_files/server7_int-ca.crt \ |
| 7458 | key_file=data_files/server7.key \ |
| 7459 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7460 | "$O_CLI -dtls1_2" \ |
| 7461 | 0 \ |
| 7462 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7463 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7464 | # Tests for DTLS-SRTP (RFC 5764) |
| 7465 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7466 | run_test "DTLS-SRTP all profiles supported" \ |
| 7467 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7468 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7469 | 0 \ |
| 7470 | -s "found use_srtp extension" \ |
| 7471 | -s "found srtp profile" \ |
| 7472 | -s "selected srtp profile" \ |
| 7473 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7474 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7475 | -c "client hello, adding use_srtp extension" \ |
| 7476 | -c "found use_srtp extension" \ |
| 7477 | -c "found srtp profile" \ |
| 7478 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7479 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7480 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7481 | -C "error" |
| 7482 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7483 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7484 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7485 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7486 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7487 | "$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] | 7488 | 0 \ |
| 7489 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7490 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7491 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7492 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7493 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7494 | -c "client hello, adding use_srtp extension" \ |
| 7495 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7496 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7497 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7498 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7499 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7500 | -C "error" |
| 7501 | |
| 7502 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7503 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7504 | "$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] | 7505 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7506 | 0 \ |
| 7507 | -s "found use_srtp extension" \ |
| 7508 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7509 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7510 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7511 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7512 | -c "client hello, adding use_srtp extension" \ |
| 7513 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7514 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7515 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7516 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7517 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7518 | -C "error" |
| 7519 | |
| 7520 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7521 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7522 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7523 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7524 | 0 \ |
| 7525 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7526 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7527 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7528 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7529 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7530 | -c "client hello, adding use_srtp extension" \ |
| 7531 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7532 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7533 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7534 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7535 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7536 | -C "error" |
| 7537 | |
| 7538 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7539 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 7540 | "$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] | 7541 | "$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] | 7542 | 0 \ |
| 7543 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7544 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7545 | -S "selected srtp profile" \ |
| 7546 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7547 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7548 | -c "client hello, adding use_srtp extension" \ |
| 7549 | -C "found use_srtp extension" \ |
| 7550 | -C "found srtp profile" \ |
| 7551 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7552 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7553 | -C "error" |
| 7554 | |
| 7555 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7556 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7557 | "$P_SRV dtls=1 debug_level=3" \ |
| 7558 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7559 | 0 \ |
| 7560 | -s "found use_srtp extension" \ |
| 7561 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7562 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7563 | -c "client hello, adding use_srtp extension" \ |
| 7564 | -C "found use_srtp extension" \ |
| 7565 | -C "found srtp profile" \ |
| 7566 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7567 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7568 | -C "error" |
| 7569 | |
| 7570 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7571 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 7572 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 7573 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7574 | 0 \ |
| 7575 | -s "found use_srtp extension" \ |
| 7576 | -s "found srtp profile" \ |
| 7577 | -s "selected srtp profile" \ |
| 7578 | -s "server hello, adding use_srtp extension" \ |
| 7579 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7580 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7581 | -c "client hello, adding use_srtp extension" \ |
| 7582 | -c "found use_srtp extension" \ |
| 7583 | -c "found srtp profile" \ |
| 7584 | -c "selected srtp profile" \ |
| 7585 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7586 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7587 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7588 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7589 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7590 | -C "error" |
| 7591 | |
| 7592 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7593 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7594 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7595 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7596 | 0 \ |
| 7597 | -s "found use_srtp extension" \ |
| 7598 | -s "found srtp profile" \ |
| 7599 | -s "selected srtp profile" \ |
| 7600 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7601 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7602 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7603 | -S "dumping 'using mki' (8 bytes)" \ |
| 7604 | -c "client hello, adding use_srtp extension" \ |
| 7605 | -c "found use_srtp extension" \ |
| 7606 | -c "found srtp profile" \ |
| 7607 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7608 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7609 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7610 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7611 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7612 | -C "dumping 'received mki' (8 bytes)" \ |
| 7613 | -C "error" |
| 7614 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7615 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7616 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7617 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7618 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7619 | 0 \ |
| 7620 | -s "found use_srtp extension" \ |
| 7621 | -s "found srtp profile" \ |
| 7622 | -s "selected srtp profile" \ |
| 7623 | -s "server hello, adding use_srtp extension" \ |
| 7624 | -s "DTLS-SRTP key material is"\ |
| 7625 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7626 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7627 | |
| 7628 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7629 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7630 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7631 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7632 | 0 \ |
| 7633 | -s "found use_srtp extension" \ |
| 7634 | -s "found srtp profile" \ |
| 7635 | -s "selected srtp profile" \ |
| 7636 | -s "server hello, adding use_srtp extension" \ |
| 7637 | -s "DTLS-SRTP key material is"\ |
| 7638 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7639 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7640 | |
| 7641 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7642 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7643 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7644 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7645 | 0 \ |
| 7646 | -s "found use_srtp extension" \ |
| 7647 | -s "found srtp profile" \ |
| 7648 | -s "selected srtp profile" \ |
| 7649 | -s "server hello, adding use_srtp extension" \ |
| 7650 | -s "DTLS-SRTP key material is"\ |
| 7651 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7652 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7653 | |
| 7654 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7655 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7656 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7657 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7658 | 0 \ |
| 7659 | -s "found use_srtp extension" \ |
| 7660 | -s "found srtp profile" \ |
| 7661 | -s "selected srtp profile" \ |
| 7662 | -s "server hello, adding use_srtp extension" \ |
| 7663 | -s "DTLS-SRTP key material is"\ |
| 7664 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7665 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7666 | |
| 7667 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7668 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7669 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7670 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7671 | 0 \ |
| 7672 | -s "found use_srtp extension" \ |
| 7673 | -s "found srtp profile" \ |
| 7674 | -s "selected srtp profile" \ |
| 7675 | -s "server hello, adding use_srtp extension" \ |
| 7676 | -s "DTLS-SRTP key material is"\ |
| 7677 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7678 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7679 | |
| 7680 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7681 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7682 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7683 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7684 | 0 \ |
| 7685 | -s "found use_srtp extension" \ |
| 7686 | -s "found srtp profile" \ |
| 7687 | -S "selected srtp profile" \ |
| 7688 | -S "server hello, adding use_srtp extension" \ |
| 7689 | -S "DTLS-SRTP key material is"\ |
| 7690 | -C "SRTP Extension negotiated, profile" |
| 7691 | |
| 7692 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7693 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7694 | "$P_SRV dtls=1 debug_level=3" \ |
| 7695 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7696 | 0 \ |
| 7697 | -s "found use_srtp extension" \ |
| 7698 | -S "server hello, adding use_srtp extension" \ |
| 7699 | -S "DTLS-SRTP key material is"\ |
| 7700 | -C "SRTP Extension negotiated, profile" |
| 7701 | |
| 7702 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7703 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7704 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7705 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7706 | 0 \ |
| 7707 | -c "client hello, adding use_srtp extension" \ |
| 7708 | -c "found use_srtp extension" \ |
| 7709 | -c "found srtp profile" \ |
| 7710 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7711 | -c "DTLS-SRTP key material is"\ |
| 7712 | -C "error" |
| 7713 | |
| 7714 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7715 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7716 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7717 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7718 | 0 \ |
| 7719 | -c "client hello, adding use_srtp extension" \ |
| 7720 | -c "found use_srtp extension" \ |
| 7721 | -c "found srtp profile" \ |
| 7722 | -c "selected srtp profile" \ |
| 7723 | -c "DTLS-SRTP key material is"\ |
| 7724 | -C "error" |
| 7725 | |
| 7726 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7727 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7728 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7729 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7730 | 0 \ |
| 7731 | -c "client hello, adding use_srtp extension" \ |
| 7732 | -c "found use_srtp extension" \ |
| 7733 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7734 | -c "selected srtp profile" \ |
| 7735 | -c "DTLS-SRTP key material is"\ |
| 7736 | -C "error" |
| 7737 | |
| 7738 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7739 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7740 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7741 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7742 | 0 \ |
| 7743 | -c "client hello, adding use_srtp extension" \ |
| 7744 | -c "found use_srtp extension" \ |
| 7745 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7746 | -c "selected srtp profile" \ |
| 7747 | -c "DTLS-SRTP key material is"\ |
| 7748 | -C "error" |
| 7749 | |
| 7750 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7751 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7752 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7753 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7754 | 0 \ |
| 7755 | -c "client hello, adding use_srtp extension" \ |
| 7756 | -c "found use_srtp extension" \ |
| 7757 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7758 | -c "selected srtp profile" \ |
| 7759 | -c "DTLS-SRTP key material is"\ |
| 7760 | -C "error" |
| 7761 | |
| 7762 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7763 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 7764 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7765 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 7766 | 0 \ |
| 7767 | -c "client hello, adding use_srtp extension" \ |
| 7768 | -C "found use_srtp extension" \ |
| 7769 | -C "found srtp profile" \ |
| 7770 | -C "selected srtp profile" \ |
| 7771 | -C "DTLS-SRTP key material is"\ |
| 7772 | -C "error" |
| 7773 | |
| 7774 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7775 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 7776 | "$O_SRV -dtls" \ |
| 7777 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7778 | 0 \ |
| 7779 | -c "client hello, adding use_srtp extension" \ |
| 7780 | -C "found use_srtp extension" \ |
| 7781 | -C "found srtp profile" \ |
| 7782 | -C "selected srtp profile" \ |
| 7783 | -C "DTLS-SRTP key material is"\ |
| 7784 | -C "error" |
| 7785 | |
| 7786 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7787 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 7788 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7789 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7790 | 0 \ |
| 7791 | -c "client hello, adding use_srtp extension" \ |
| 7792 | -c "found use_srtp extension" \ |
| 7793 | -c "found srtp profile" \ |
| 7794 | -c "selected srtp profile" \ |
| 7795 | -c "DTLS-SRTP key material is"\ |
| 7796 | -c "DTLS-SRTP no mki value negotiated"\ |
| 7797 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7798 | -C "dumping 'received mki' (8 bytes)" \ |
| 7799 | -C "error" |
| 7800 | |
| 7801 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7802 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7803 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7804 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7805 | "$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] | 7806 | 0 \ |
| 7807 | -s "found use_srtp extension" \ |
| 7808 | -s "found srtp profile" \ |
| 7809 | -s "selected srtp profile" \ |
| 7810 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7811 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7812 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 7813 | |
| 7814 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7815 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7816 | 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] | 7817 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7818 | "$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] | 7819 | 0 \ |
| 7820 | -s "found use_srtp extension" \ |
| 7821 | -s "found srtp profile" \ |
| 7822 | -s "selected srtp profile" \ |
| 7823 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7824 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7825 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 7826 | |
| 7827 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7828 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7829 | 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] | 7830 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7831 | "$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] | 7832 | 0 \ |
| 7833 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7834 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7835 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7836 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7837 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7838 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7839 | |
| 7840 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7841 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7842 | 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] | 7843 | "$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] | 7844 | "$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] | 7845 | 0 \ |
| 7846 | -s "found use_srtp extension" \ |
| 7847 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7848 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7849 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7850 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7851 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 7852 | |
| 7853 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7854 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7855 | 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] | 7856 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7857 | "$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] | 7858 | 0 \ |
| 7859 | -s "found use_srtp extension" \ |
| 7860 | -s "found srtp profile" \ |
| 7861 | -s "selected srtp profile" \ |
| 7862 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7863 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7864 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7865 | |
| 7866 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7867 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7868 | 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] | 7869 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7870 | "$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] | 7871 | 0 \ |
| 7872 | -s "found use_srtp extension" \ |
| 7873 | -s "found srtp profile" \ |
| 7874 | -S "selected srtp profile" \ |
| 7875 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7876 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7877 | -C "SRTP profile:" |
| 7878 | |
| 7879 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7880 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7881 | 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] | 7882 | "$P_SRV dtls=1 debug_level=3" \ |
| 7883 | "$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] | 7884 | 0 \ |
| 7885 | -s "found use_srtp extension" \ |
| 7886 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7887 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7888 | -C "SRTP profile:" |
| 7889 | |
| 7890 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7891 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7892 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 7893 | "$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" \ |
| 7894 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7895 | 0 \ |
| 7896 | -c "client hello, adding use_srtp extension" \ |
| 7897 | -c "found use_srtp extension" \ |
| 7898 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7899 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7900 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7901 | -C "error" |
| 7902 | |
| 7903 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7904 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7905 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 7906 | "$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" \ |
| 7907 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7908 | 0 \ |
| 7909 | -c "client hello, adding use_srtp extension" \ |
| 7910 | -c "found use_srtp extension" \ |
| 7911 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7912 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7913 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7914 | -C "error" |
| 7915 | |
| 7916 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7917 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7918 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 7919 | "$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" \ |
| 7920 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7921 | 0 \ |
| 7922 | -c "client hello, adding use_srtp extension" \ |
| 7923 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7924 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7925 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7926 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7927 | -C "error" |
| 7928 | |
| 7929 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7930 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7931 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 7932 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7933 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7934 | 0 \ |
| 7935 | -c "client hello, adding use_srtp extension" \ |
| 7936 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7937 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7938 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7939 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7940 | -C "error" |
| 7941 | |
| 7942 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7943 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7944 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 7945 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7946 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7947 | 0 \ |
| 7948 | -c "client hello, adding use_srtp extension" \ |
| 7949 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7950 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7951 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7952 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7953 | -C "error" |
| 7954 | |
| 7955 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7956 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7957 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 7958 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7959 | "$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] | 7960 | 0 \ |
| 7961 | -c "client hello, adding use_srtp extension" \ |
| 7962 | -C "found use_srtp extension" \ |
| 7963 | -C "found srtp profile" \ |
| 7964 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7965 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7966 | -C "error" |
| 7967 | |
| 7968 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7969 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7970 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 7971 | "$G_SRV -u" \ |
| 7972 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7973 | 0 \ |
| 7974 | -c "client hello, adding use_srtp extension" \ |
| 7975 | -C "found use_srtp extension" \ |
| 7976 | -C "found srtp profile" \ |
| 7977 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7978 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7979 | -C "error" |
| 7980 | |
| 7981 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7982 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7983 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 7984 | "$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" \ |
| 7985 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7986 | 0 \ |
| 7987 | -c "client hello, adding use_srtp extension" \ |
| 7988 | -c "found use_srtp extension" \ |
| 7989 | -c "found srtp profile" \ |
| 7990 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7991 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7992 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7993 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7994 | -c "dumping 'received mki' (8 bytes)" \ |
| 7995 | -C "error" |
| 7996 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7997 | # Tests for specific things with "unreliable" UDP connection |
| 7998 | |
| 7999 | not_with_valgrind # spurious resend due to timeout |
| 8000 | run_test "DTLS proxy: reference" \ |
| 8001 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8002 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8003 | "$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] | 8004 | 0 \ |
| 8005 | -C "replayed record" \ |
| 8006 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8007 | -C "Buffer record from epoch" \ |
| 8008 | -S "Buffer record from epoch" \ |
| 8009 | -C "ssl_buffer_message" \ |
| 8010 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8011 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8012 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8013 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8014 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8015 | -c "HTTP/1.0 200 OK" |
| 8016 | |
| 8017 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8018 | run_test "DTLS proxy: duplicate every packet" \ |
| 8019 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8020 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8021 | "$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] | 8022 | 0 \ |
| 8023 | -c "replayed record" \ |
| 8024 | -s "replayed record" \ |
| 8025 | -c "record from another epoch" \ |
| 8026 | -s "record from another epoch" \ |
| 8027 | -S "resend" \ |
| 8028 | -s "Extra-header:" \ |
| 8029 | -c "HTTP/1.0 200 OK" |
| 8030 | |
| 8031 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8032 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8033 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8034 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8035 | 0 \ |
| 8036 | -c "replayed record" \ |
| 8037 | -S "replayed record" \ |
| 8038 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8039 | -s "record from another epoch" \ |
| 8040 | -c "resend" \ |
| 8041 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8042 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8043 | -c "HTTP/1.0 200 OK" |
| 8044 | |
| 8045 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8046 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8047 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8048 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8049 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8050 | -c "next record in same datagram" \ |
| 8051 | -s "next record in same datagram" |
| 8052 | |
| 8053 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8054 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8055 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8056 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8057 | 0 \ |
| 8058 | -c "next record in same datagram" \ |
| 8059 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8060 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8061 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8062 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8063 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8064 | "$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] | 8065 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8066 | -c "discarding invalid record (mac)" \ |
| 8067 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8068 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8069 | -c "HTTP/1.0 200 OK" \ |
| 8070 | -S "too many records with bad MAC" \ |
| 8071 | -S "Verification of the message MAC failed" |
| 8072 | |
| 8073 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8074 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8075 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8076 | "$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] | 8077 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8078 | -C "discarding invalid record (mac)" \ |
| 8079 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8080 | -S "Extra-header:" \ |
| 8081 | -C "HTTP/1.0 200 OK" \ |
| 8082 | -s "too many records with bad MAC" \ |
| 8083 | -s "Verification of the message MAC failed" |
| 8084 | |
| 8085 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8086 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8087 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8088 | "$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] | 8089 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8090 | -c "discarding invalid record (mac)" \ |
| 8091 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8092 | -s "Extra-header:" \ |
| 8093 | -c "HTTP/1.0 200 OK" \ |
| 8094 | -S "too many records with bad MAC" \ |
| 8095 | -S "Verification of the message MAC failed" |
| 8096 | |
| 8097 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8098 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8099 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8100 | "$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] | 8101 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8102 | -c "discarding invalid record (mac)" \ |
| 8103 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8104 | -s "Extra-header:" \ |
| 8105 | -c "HTTP/1.0 200 OK" \ |
| 8106 | -s "too many records with bad MAC" \ |
| 8107 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8108 | |
| 8109 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8110 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8111 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8112 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8113 | 0 \ |
| 8114 | -c "record from another epoch" \ |
| 8115 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8116 | -s "Extra-header:" \ |
| 8117 | -c "HTTP/1.0 200 OK" |
| 8118 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8119 | # Tests for reordering support with DTLS |
| 8120 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8121 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8122 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8123 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8124 | hs_timeout=2500-60000" \ |
| 8125 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8126 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8127 | 0 \ |
| 8128 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8129 | -c "Next handshake message has been buffered - load"\ |
| 8130 | -S "Buffering HS message" \ |
| 8131 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8132 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8133 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8134 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8135 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8136 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8137 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8138 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8139 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8140 | hs_timeout=2500-60000" \ |
| 8141 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8142 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8143 | 0 \ |
| 8144 | -c "Buffering HS message" \ |
| 8145 | -c "found fragmented DTLS handshake message"\ |
| 8146 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8147 | -c "Next handshake message has been buffered - load"\ |
| 8148 | -S "Buffering HS message" \ |
| 8149 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8150 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8151 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8152 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8153 | -S "Remember CCS message" |
| 8154 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8155 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8156 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8157 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8158 | # while keeping the ServerKeyExchange. |
| 8159 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8160 | 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] | 8161 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8162 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8163 | hs_timeout=2500-60000" \ |
| 8164 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8165 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8166 | 0 \ |
| 8167 | -c "Buffering HS message" \ |
| 8168 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8169 | -C "attempt to make space by freeing buffered messages" \ |
| 8170 | -S "Buffering HS message" \ |
| 8171 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8172 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8173 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8174 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8175 | -S "Remember CCS message" |
| 8176 | |
| 8177 | # The size constraints ensure that the delayed certificate message can't |
| 8178 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8179 | # when dropping it first. |
| 8180 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8181 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8182 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8183 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8184 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8185 | hs_timeout=2500-60000" \ |
| 8186 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8187 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8188 | 0 \ |
| 8189 | -c "Buffering HS message" \ |
| 8190 | -c "attempt to make space by freeing buffered future messages" \ |
| 8191 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8192 | -S "Buffering HS message" \ |
| 8193 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8194 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8195 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8196 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8197 | -S "Remember CCS message" |
| 8198 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8199 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8200 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8201 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8202 | hs_timeout=2500-60000" \ |
| 8203 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8204 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8205 | 0 \ |
| 8206 | -C "Buffering HS message" \ |
| 8207 | -C "Next handshake message has been buffered - load"\ |
| 8208 | -s "Buffering HS message" \ |
| 8209 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8210 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8211 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8212 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8213 | -S "Remember CCS message" |
| 8214 | |
| 8215 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8216 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8217 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8218 | hs_timeout=2500-60000" \ |
| 8219 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8220 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8221 | 0 \ |
| 8222 | -C "Buffering HS message" \ |
| 8223 | -C "Next handshake message has been buffered - load"\ |
| 8224 | -S "Buffering HS message" \ |
| 8225 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8226 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8227 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8228 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8229 | -S "Remember CCS message" |
| 8230 | |
| 8231 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8232 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8233 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8234 | hs_timeout=2500-60000" \ |
| 8235 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8236 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8237 | 0 \ |
| 8238 | -C "Buffering HS message" \ |
| 8239 | -C "Next handshake message has been buffered - load"\ |
| 8240 | -S "Buffering HS message" \ |
| 8241 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8242 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8243 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8244 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8245 | -s "Remember CCS message" |
| 8246 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8247 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8248 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8249 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8250 | hs_timeout=2500-60000" \ |
| 8251 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8252 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8253 | 0 \ |
| 8254 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8255 | -s "Found buffered record from current epoch - load" \ |
| 8256 | -c "Buffer record from epoch 1" \ |
| 8257 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8258 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8259 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8260 | # from the server are delayed, so that the encrypted Finished message |
| 8261 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8262 | # in afterwards, the encrypted Finished message must be freed in order |
| 8263 | # to make space for the NewSessionTicket to be reassembled. |
| 8264 | # This works only in very particular circumstances: |
| 8265 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8266 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8267 | # the encrypted Finished message. |
| 8268 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8269 | # needs to be fragmented. |
| 8270 | # - All messages sent by the server must be small enough to be either sent |
| 8271 | # without fragmentation or be reassembled within the bounds of |
| 8272 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8273 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8274 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8275 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8276 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8277 | -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] | 8278 | "$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] | 8279 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8280 | 0 \ |
| 8281 | -s "Buffer record from epoch 1" \ |
| 8282 | -s "Found buffered record from current epoch - load" \ |
| 8283 | -c "Buffer record from epoch 1" \ |
| 8284 | -C "Found buffered record from current epoch - load" \ |
| 8285 | -c "Enough space available after freeing future epoch record" |
| 8286 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8287 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8288 | |
| 8289 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8290 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8291 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8292 | "$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] | 8293 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8294 | "$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] | 8295 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8296 | 0 \ |
| 8297 | -s "Extra-header:" \ |
| 8298 | -c "HTTP/1.0 200 OK" |
| 8299 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8300 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8301 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8302 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8303 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8304 | "$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] | 8305 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8306 | 0 \ |
| 8307 | -s "Extra-header:" \ |
| 8308 | -c "HTTP/1.0 200 OK" |
| 8309 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8310 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8311 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8312 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8313 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8314 | "$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] | 8315 | 0 \ |
| 8316 | -s "Extra-header:" \ |
| 8317 | -c "HTTP/1.0 200 OK" |
| 8318 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8319 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8320 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8321 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8322 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8323 | "$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] | 8324 | 0 \ |
| 8325 | -s "Extra-header:" \ |
| 8326 | -c "HTTP/1.0 200 OK" |
| 8327 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8328 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8329 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8330 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8331 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8332 | "$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] | 8333 | 0 \ |
| 8334 | -s "Extra-header:" \ |
| 8335 | -c "HTTP/1.0 200 OK" |
| 8336 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8337 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8338 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8339 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8340 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8341 | "$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] | 8342 | 0 \ |
| 8343 | -s "Extra-header:" \ |
| 8344 | -c "HTTP/1.0 200 OK" |
| 8345 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8346 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8347 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8348 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8349 | "$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] | 8350 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8351 | "$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] | 8352 | 0 \ |
| 8353 | -s "Extra-header:" \ |
| 8354 | -c "HTTP/1.0 200 OK" |
| 8355 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8356 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8357 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8358 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8359 | "$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] | 8360 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8361 | "$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] | 8362 | 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] | 8363 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8364 | 0 \ |
| 8365 | -s "a session has been resumed" \ |
| 8366 | -c "a session has been resumed" \ |
| 8367 | -s "Extra-header:" \ |
| 8368 | -c "HTTP/1.0 200 OK" |
| 8369 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8370 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8371 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8372 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8373 | "$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] | 8374 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8375 | "$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] | 8376 | 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] | 8377 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8378 | 0 \ |
| 8379 | -s "a session has been resumed" \ |
| 8380 | -c "a session has been resumed" \ |
| 8381 | -s "Extra-header:" \ |
| 8382 | -c "HTTP/1.0 200 OK" |
| 8383 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8384 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8385 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8386 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8387 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8388 | "$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] | 8389 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8390 | "$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] | 8391 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8392 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8393 | 0 \ |
| 8394 | -c "=> renegotiate" \ |
| 8395 | -s "=> renegotiate" \ |
| 8396 | -s "Extra-header:" \ |
| 8397 | -c "HTTP/1.0 200 OK" |
| 8398 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8399 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8400 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8401 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8402 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8403 | "$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] | 8404 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8405 | "$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] | 8406 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8407 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8408 | 0 \ |
| 8409 | -c "=> renegotiate" \ |
| 8410 | -s "=> renegotiate" \ |
| 8411 | -s "Extra-header:" \ |
| 8412 | -c "HTTP/1.0 200 OK" |
| 8413 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8414 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8415 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8416 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8417 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8418 | "$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] | 8419 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8420 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8421 | "$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] | 8422 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8423 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8424 | 0 \ |
| 8425 | -c "=> renegotiate" \ |
| 8426 | -s "=> renegotiate" \ |
| 8427 | -s "Extra-header:" \ |
| 8428 | -c "HTTP/1.0 200 OK" |
| 8429 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8430 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8431 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8432 | 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] | 8433 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8434 | "$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] | 8435 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8436 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8437 | "$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] | 8438 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8439 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8440 | 0 \ |
| 8441 | -c "=> renegotiate" \ |
| 8442 | -s "=> renegotiate" \ |
| 8443 | -s "Extra-header:" \ |
| 8444 | -c "HTTP/1.0 200 OK" |
| 8445 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8446 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8447 | ## all versions installed on the CI machines), reported here: |
| 8448 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8449 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8450 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8451 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8452 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8453 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8454 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8455 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8456 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8457 | "$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] | 8458 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8459 | -c "HTTP/1.0 200 OK" |
| 8460 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8461 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8462 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8463 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8464 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8465 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8466 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8467 | "$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] | 8468 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8469 | -c "HTTP/1.0 200 OK" |
| 8470 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8471 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8472 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8473 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8474 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8475 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8476 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8477 | "$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] | 8478 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8479 | -c "HTTP/1.0 200 OK" |
| 8480 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8481 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8482 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8483 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8484 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8485 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8486 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8487 | "$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] | 8488 | 0 \ |
| 8489 | -s "Extra-header:" \ |
| 8490 | -c "Extra-header:" |
| 8491 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8492 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8493 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8494 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8495 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8496 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8497 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8498 | "$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] | 8499 | 0 \ |
| 8500 | -s "Extra-header:" \ |
| 8501 | -c "Extra-header:" |
| 8502 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8503 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8504 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8505 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8506 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8507 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8508 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8509 | "$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] | 8510 | 0 \ |
| 8511 | -s "Extra-header:" \ |
| 8512 | -c "Extra-header:" |
| 8513 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8514 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8515 | run_test "export keys functionality" \ |
| 8516 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8517 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8518 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8519 | -c "EAP-TLS key material is:"\ |
| 8520 | -s "EAP-TLS key material is:"\ |
| 8521 | -c "EAP-TLS IV is:" \ |
| 8522 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8523 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8524 | # TLS1.3 test cases |
| 8525 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 8526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8528 | skip_handshake_stage_check |
| 8529 | run_test "TLS1.3: Not supported version check: tls1_2 and tls1_3" \ |
| 8530 | "$P_SRV debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8531 | "$P_CLI debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8532 | 1 \ |
| 8533 | -s "SSL - The requested feature is not available" \ |
| 8534 | -c "SSL - The requested feature is not available" \ |
| 8535 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 8536 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 8537 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8538 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8540 | run_test "TLS1.3: handshake dispatch test: tls1_3 only" \ |
| 8541 | "$P_SRV min_version=tls1_3 max_version=tls1_3" \ |
| 8542 | "$P_CLI min_version=tls1_3 max_version=tls1_3" \ |
| 8543 | 1 \ |
| 8544 | -s "SSL - The requested feature is not available" \ |
| 8545 | -c "SSL - The requested feature is not available" |
| 8546 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8547 | # Test heap memory usage after handshake |
| 8548 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8549 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8550 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8551 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8552 | run_tests_memory_after_hanshake |
| 8553 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8554 | # Final report |
| 8555 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8556 | echo "------------------------------------------------------------------------" |
| 8557 | |
| 8558 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8559 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8560 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8561 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8562 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8563 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8564 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8565 | |
| 8566 | exit $FAILS |