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} |
Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 48 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 49 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 50 | : ${GNUTLS_CLI:=gnutls-cli} |
| 51 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 52 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 53 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 54 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 55 | 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] | 56 | echo "default" |
| 57 | else |
| 58 | echo "unknown" |
| 59 | fi |
| 60 | } |
| 61 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 62 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 63 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 64 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 65 | 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] | 66 | 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] | 67 | 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] | 68 | 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] | 69 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 70 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 71 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 72 | |
| 73 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 74 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 75 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 76 | else |
| 77 | O_LEGACY_SRV=false |
| 78 | O_LEGACY_CLI=false |
| 79 | fi |
| 80 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 81 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
XiaokangQian | 30f5560 | 2021-11-24 01:54:50 +0000 | [diff] [blame] | 82 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 83 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 84 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
| 85 | else |
| 86 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 87 | O_NEXT_SRV_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 88 | O_NEXT_CLI=false |
| 89 | fi |
| 90 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 91 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 92 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 93 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 94 | else |
| 95 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 96 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 97 | fi |
| 98 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 99 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 100 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 101 | else |
| 102 | G_NEXT_CLI=false |
| 103 | fi |
| 104 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 105 | TESTS=0 |
| 106 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 107 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 108 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 109 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 110 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 111 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 112 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 113 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 114 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 115 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 116 | RUN_TEST_NUMBER='' |
| 117 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 118 | PRESERVE_LOGS=0 |
| 119 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 120 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 121 | # port which is this plus 10000. Each port number may be independently |
| 122 | # overridden by a command line option. |
| 123 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 124 | PXY_PORT=$((SRV_PORT + 10000)) |
| 125 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 126 | print_usage() { |
| 127 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 128 | printf " -h|--help\tPrint this help.\n" |
| 129 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 130 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 131 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 132 | 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] | 133 | 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] | 134 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 135 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 136 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 137 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 138 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 139 | 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] | 140 | } |
| 141 | |
| 142 | get_options() { |
| 143 | while [ $# -gt 0 ]; do |
| 144 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 145 | -f|--filter) |
| 146 | shift; FILTER=$1 |
| 147 | ;; |
| 148 | -e|--exclude) |
| 149 | shift; EXCLUDE=$1 |
| 150 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 151 | -m|--memcheck) |
| 152 | MEMCHECK=1 |
| 153 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 154 | -n|--number) |
| 155 | shift; RUN_TEST_NUMBER=$1 |
| 156 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 157 | -s|--show-numbers) |
| 158 | SHOW_TEST_NUMBER=1 |
| 159 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 160 | -p|--preserve-logs) |
| 161 | PRESERVE_LOGS=1 |
| 162 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 163 | --port) |
| 164 | shift; SRV_PORT=$1 |
| 165 | ;; |
| 166 | --proxy-port) |
| 167 | shift; PXY_PORT=$1 |
| 168 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 169 | --seed) |
| 170 | shift; SEED="$1" |
| 171 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 172 | -h|--help) |
| 173 | print_usage |
| 174 | exit 0 |
| 175 | ;; |
| 176 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 177 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 178 | print_usage |
| 179 | exit 1 |
| 180 | ;; |
| 181 | esac |
| 182 | shift |
| 183 | done |
| 184 | } |
| 185 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 186 | # Make the outcome file path relative to the original directory, not |
| 187 | # to .../tests |
| 188 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 189 | [!/]*) |
| 190 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 191 | ;; |
| 192 | esac |
| 193 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 194 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 195 | # testing. Skip non-boolean options (with something other than spaces |
| 196 | # and a comment after "#define SYMBOL"). The variable contains a |
| 197 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 198 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 199 | # Skip next test; use this macro to skip tests which are legitimate |
| 200 | # in theory and expected to be re-introduced at some point, but |
| 201 | # aren't expected to succeed at the moment due to problems outside |
| 202 | # our control (such as bugs in other TLS implementations). |
| 203 | skip_next_test() { |
| 204 | SKIP_NEXT="YES" |
| 205 | } |
| 206 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 207 | # 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] | 208 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 209 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 210 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 211 | *) SKIP_NEXT="YES";; |
| 212 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 213 | } |
| 214 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 215 | # 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] | 216 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 217 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 218 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 219 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 220 | } |
| 221 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 222 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 223 | # This function uses the query_config command line option to query the |
| 224 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 225 | # program. The command will always return a success value if the |
| 226 | # configuration is defined and the value will be printed to stdout. |
| 227 | # |
| 228 | # Note that if the configuration is not defined or is defined to nothing, |
| 229 | # the output of this function will be an empty string. |
| 230 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 234 | VAL="$( get_config_value_or_default "$1" )" |
| 235 | if [ -z "$VAL" ]; then |
| 236 | # Should never happen |
| 237 | echo "Mbed TLS configuration $1 is not defined" |
| 238 | exit 1 |
| 239 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 240 | SKIP_NEXT="YES" |
| 241 | fi |
| 242 | } |
| 243 | |
| 244 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 245 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 246 | if [ -z "$VAL" ]; then |
| 247 | # Should never happen |
| 248 | echo "Mbed TLS configuration $1 is not defined" |
| 249 | exit 1 |
| 250 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 251 | SKIP_NEXT="YES" |
| 252 | fi |
| 253 | } |
| 254 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 255 | requires_config_value_equals() { |
| 256 | VAL=$( get_config_value_or_default "$1" ) |
| 257 | if [ -z "$VAL" ]; then |
| 258 | # Should never happen |
| 259 | echo "Mbed TLS configuration $1 is not defined" |
| 260 | exit 1 |
| 261 | elif [ "$VAL" -ne "$2" ]; then |
| 262 | SKIP_NEXT="YES" |
| 263 | fi |
| 264 | } |
| 265 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 266 | # Space-separated list of ciphersuites supported by this build of |
| 267 | # Mbed TLS. |
| 268 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 269 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 271 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 272 | case $P_CIPHERSUITES in |
| 273 | *" $1 "*) :;; |
| 274 | *) SKIP_NEXT="YES";; |
| 275 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 276 | } |
| 277 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 278 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 279 | # If CMD (call to a TLS client or server program) requires a specific |
| 280 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 281 | # enabled. |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 282 | maybe_requires_ciphersuite_enabled() { |
| 283 | case "$1" in |
| 284 | *\ force_ciphersuite=*) :;; |
| 285 | *) return;; # No specific required ciphersuite |
| 286 | esac |
| 287 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 288 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 289 | shift |
| 290 | |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 291 | requires_ciphersuite_enabled "$ciphersuite" |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 292 | |
| 293 | unset ciphersuite |
| 294 | } |
| 295 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 296 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 297 | requires_openssl_with_fallback_scsv() { |
| 298 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 299 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 300 | then |
| 301 | OPENSSL_HAS_FBSCSV="YES" |
| 302 | else |
| 303 | OPENSSL_HAS_FBSCSV="NO" |
| 304 | fi |
| 305 | fi |
| 306 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 307 | SKIP_NEXT="YES" |
| 308 | fi |
| 309 | } |
| 310 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 311 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 312 | requires_max_content_len() { |
| 313 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 314 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 315 | } |
| 316 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 317 | # skip next test if GnuTLS isn't available |
| 318 | requires_gnutls() { |
| 319 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 320 | 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] | 321 | GNUTLS_AVAILABLE="YES" |
| 322 | else |
| 323 | GNUTLS_AVAILABLE="NO" |
| 324 | fi |
| 325 | fi |
| 326 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 327 | SKIP_NEXT="YES" |
| 328 | fi |
| 329 | } |
| 330 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 331 | # skip next test if GnuTLS-next isn't available |
| 332 | requires_gnutls_next() { |
| 333 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 334 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 335 | GNUTLS_NEXT_AVAILABLE="YES" |
| 336 | else |
| 337 | GNUTLS_NEXT_AVAILABLE="NO" |
| 338 | fi |
| 339 | fi |
| 340 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 341 | SKIP_NEXT="YES" |
| 342 | fi |
| 343 | } |
| 344 | |
| 345 | # skip next test if OpenSSL-legacy isn't available |
| 346 | requires_openssl_legacy() { |
| 347 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 348 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 349 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 350 | else |
| 351 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 352 | fi |
| 353 | fi |
| 354 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 355 | SKIP_NEXT="YES" |
| 356 | fi |
| 357 | } |
| 358 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 359 | requires_openssl_next() { |
| 360 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 361 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 362 | OPENSSL_NEXT_AVAILABLE="YES" |
| 363 | else |
| 364 | OPENSSL_NEXT_AVAILABLE="NO" |
| 365 | fi |
| 366 | fi |
| 367 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 368 | SKIP_NEXT="YES" |
| 369 | fi |
| 370 | } |
| 371 | |
| 372 | # skip next test if tls1_3 is not available |
| 373 | requires_openssl_tls1_3() { |
| 374 | requires_openssl_next |
| 375 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 376 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 377 | fi |
| 378 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 379 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 380 | then |
| 381 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 382 | else |
| 383 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 384 | fi |
| 385 | fi |
| 386 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 387 | SKIP_NEXT="YES" |
| 388 | fi |
| 389 | } |
| 390 | |
| 391 | # skip next test if tls1_3 is not available |
| 392 | requires_gnutls_tls1_3() { |
| 393 | requires_gnutls_next |
| 394 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 395 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 396 | fi |
| 397 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 398 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 399 | then |
| 400 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 401 | else |
| 402 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 403 | fi |
| 404 | fi |
| 405 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 406 | SKIP_NEXT="YES" |
| 407 | fi |
| 408 | } |
| 409 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 410 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 411 | requires_gnutls_next_no_ticket() { |
| 412 | requires_gnutls_next |
| 413 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 414 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 415 | fi |
| 416 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 417 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 418 | then |
| 419 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 420 | else |
| 421 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 422 | fi |
| 423 | fi |
| 424 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 425 | SKIP_NEXT="YES" |
| 426 | fi |
| 427 | } |
| 428 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 429 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 430 | requires_gnutls_next_disable_tls13_compat() { |
| 431 | requires_gnutls_next |
| 432 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 433 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 434 | fi |
| 435 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 436 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 437 | then |
| 438 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 439 | else |
| 440 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 441 | fi |
| 442 | fi |
| 443 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 444 | SKIP_NEXT="YES" |
| 445 | fi |
| 446 | } |
| 447 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 448 | # skip next test if IPv6 isn't available on this host |
| 449 | requires_ipv6() { |
| 450 | if [ -z "${HAS_IPV6:-}" ]; then |
| 451 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 452 | SRV_PID=$! |
| 453 | sleep 1 |
| 454 | kill $SRV_PID >/dev/null 2>&1 |
| 455 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 456 | HAS_IPV6="NO" |
| 457 | else |
| 458 | HAS_IPV6="YES" |
| 459 | fi |
| 460 | rm -r $SRV_OUT |
| 461 | fi |
| 462 | |
| 463 | if [ "$HAS_IPV6" = "NO" ]; then |
| 464 | SKIP_NEXT="YES" |
| 465 | fi |
| 466 | } |
| 467 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 468 | # skip next test if it's i686 or uname is not available |
| 469 | requires_not_i686() { |
| 470 | if [ -z "${IS_I686:-}" ]; then |
| 471 | IS_I686="YES" |
| 472 | if which "uname" >/dev/null 2>&1; then |
| 473 | if [ -z "$(uname -a | grep i686)" ]; then |
| 474 | IS_I686="NO" |
| 475 | fi |
| 476 | fi |
| 477 | fi |
| 478 | if [ "$IS_I686" = "YES" ]; then |
| 479 | SKIP_NEXT="YES" |
| 480 | fi |
| 481 | } |
| 482 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 483 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 484 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 485 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 486 | 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] | 487 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 488 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 489 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 490 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 491 | fi |
| 492 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 493 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 494 | fi |
| 495 | |
| 496 | # skip the next test if the SSL output buffer is less than 16KB |
| 497 | requires_full_size_output_buffer() { |
| 498 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 499 | SKIP_NEXT="YES" |
| 500 | fi |
| 501 | } |
| 502 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 503 | # skip the next test if valgrind is in use |
| 504 | not_with_valgrind() { |
| 505 | if [ "$MEMCHECK" -gt 0 ]; then |
| 506 | SKIP_NEXT="YES" |
| 507 | fi |
| 508 | } |
| 509 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 510 | # skip the next test if valgrind is NOT in use |
| 511 | only_with_valgrind() { |
| 512 | if [ "$MEMCHECK" -eq 0 ]; then |
| 513 | SKIP_NEXT="YES" |
| 514 | fi |
| 515 | } |
| 516 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 517 | # 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] | 518 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 519 | CLI_DELAY_FACTOR=$1 |
| 520 | } |
| 521 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 522 | # wait for the given seconds after the client finished in the next test |
| 523 | server_needs_more_time() { |
| 524 | SRV_DELAY_SECONDS=$1 |
| 525 | } |
| 526 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 527 | # print_name <name> |
| 528 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 529 | TESTS=$(( $TESTS + 1 )) |
| 530 | LINE="" |
| 531 | |
| 532 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 533 | LINE="$TESTS " |
| 534 | fi |
| 535 | |
| 536 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 537 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 538 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 539 | for i in `seq 1 $LEN`; do printf '.'; done |
| 540 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 541 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 542 | } |
| 543 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 544 | # record_outcome <outcome> [<failure-reason>] |
| 545 | # The test name must be in $NAME. |
| 546 | record_outcome() { |
| 547 | echo "$1" |
| 548 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 549 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 550 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 551 | "ssl-opt" "$NAME" \ |
| 552 | "$1" "${2-}" \ |
| 553 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 554 | fi |
| 555 | } |
| 556 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 557 | # True if the presence of the given pattern in a log definitely indicates |
| 558 | # that the test has failed. False if the presence is inconclusive. |
| 559 | # |
| 560 | # Inputs: |
| 561 | # * $1: pattern found in the logs |
| 562 | # * $TIMES_LEFT: >0 if retrying is an option |
| 563 | # |
| 564 | # Outputs: |
| 565 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 566 | # unchanged otherwise. |
| 567 | # * Return value: 1 if the pattern is inconclusive, |
| 568 | # 0 if the failure is definitive. |
| 569 | log_pattern_presence_is_conclusive() { |
| 570 | # If we've run out of attempts, then don't retry no matter what. |
| 571 | if [ $TIMES_LEFT -eq 0 ]; then |
| 572 | return 0 |
| 573 | fi |
| 574 | case $1 in |
| 575 | "resend") |
| 576 | # An undesired resend may have been caused by the OS dropping or |
| 577 | # delaying a packet at an inopportune time. |
| 578 | outcome="RETRY(resend)" |
| 579 | return 1;; |
| 580 | esac |
| 581 | } |
| 582 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 583 | # fail <message> |
| 584 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 585 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 586 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 587 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 588 | mv $SRV_OUT o-srv-${TESTS}.log |
| 589 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 590 | if [ -n "$PXY_CMD" ]; then |
| 591 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 592 | fi |
| 593 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 594 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 595 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 596 | echo " ! server output:" |
| 597 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 598 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 599 | echo " ! client output:" |
| 600 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 601 | if [ -n "$PXY_CMD" ]; then |
| 602 | echo " ! ========================================================" |
| 603 | echo " ! proxy output:" |
| 604 | cat o-pxy-${TESTS}.log |
| 605 | fi |
| 606 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 607 | fi |
| 608 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 609 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 610 | } |
| 611 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 612 | # is_polar <cmd_line> |
| 613 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 614 | case "$1" in |
| 615 | *ssl_client2*) true;; |
| 616 | *ssl_server2*) true;; |
| 617 | *) false;; |
| 618 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 619 | } |
| 620 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 621 | # openssl s_server doesn't have -www with DTLS |
| 622 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 623 | case "$SRV_CMD" in |
| 624 | *s_server*-dtls*) |
| 625 | NEEDS_INPUT=1 |
| 626 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 627 | *) NEEDS_INPUT=0;; |
| 628 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 629 | } |
| 630 | |
| 631 | # provide input to commands that need it |
| 632 | provide_input() { |
| 633 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 634 | return |
| 635 | fi |
| 636 | |
| 637 | while true; do |
| 638 | echo "HTTP/1.0 200 OK" |
| 639 | sleep 1 |
| 640 | done |
| 641 | } |
| 642 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 643 | # has_mem_err <log_file_name> |
| 644 | has_mem_err() { |
| 645 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 646 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 647 | then |
| 648 | return 1 # false: does not have errors |
| 649 | else |
| 650 | return 0 # true: has errors |
| 651 | fi |
| 652 | } |
| 653 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 654 | # 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] | 655 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 656 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 657 | newline=' |
| 658 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 659 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 660 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 661 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 662 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 663 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 664 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 665 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 666 | while true; do |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 667 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p) |
| 668 | # When we use a proxy, it will be listening on the same port we |
| 669 | # are checking for as well as the server and lsof will list both. |
| 670 | # If multiple PIDs are returned, each one will be on a separate |
| 671 | # line, each prepended with 'p'. |
| 672 | case ${newline}${SERVER_PIDS}${newline} in |
| 673 | *${newline}p${2}${newline}*) break;; |
| 674 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 675 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 676 | echo "$3 START TIMEOUT" |
| 677 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 678 | break |
| 679 | fi |
| 680 | # Linux and *BSD support decimal arguments to sleep. On other |
| 681 | # OSes this may be a tight loop. |
| 682 | sleep 0.1 2>/dev/null || true |
| 683 | done |
| 684 | } |
| 685 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 686 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 687 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 688 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 689 | } |
| 690 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 691 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 692 | # Wait for server process $2 to be listening on port $1. |
| 693 | wait_server_start() { |
| 694 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 695 | } |
| 696 | |
| 697 | # Wait for proxy process $2 to be listening on port $1. |
| 698 | wait_proxy_start() { |
| 699 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 700 | } |
| 701 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 702 | # 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] | 703 | # 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] | 704 | # acceptable bounds |
| 705 | check_server_hello_time() { |
| 706 | # 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] | 707 | 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] | 708 | # Get the Unix timestamp for now |
| 709 | CUR_TIME=$(date +'%s') |
| 710 | THRESHOLD_IN_SECS=300 |
| 711 | |
| 712 | # Check if the ServerHello time was printed |
| 713 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 714 | return 1 |
| 715 | fi |
| 716 | |
| 717 | # Check the time in ServerHello is within acceptable bounds |
| 718 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 719 | # The time in ServerHello is at least 5 minutes before now |
| 720 | return 1 |
| 721 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 722 | # 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] | 723 | return 1 |
| 724 | else |
| 725 | return 0 |
| 726 | fi |
| 727 | } |
| 728 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 729 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 730 | handshake_memory_get() { |
| 731 | OUTPUT_VARIABLE="$1" |
| 732 | OUTPUT_FILE="$2" |
| 733 | |
| 734 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 735 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 736 | |
| 737 | # Check if memory usage was read |
| 738 | if [ -z "$MEM_USAGE" ]; then |
| 739 | echo "Error: Can not read the value of handshake memory usage" |
| 740 | return 1 |
| 741 | else |
| 742 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 743 | return 0 |
| 744 | fi |
| 745 | } |
| 746 | |
| 747 | # Get handshake memory usage from server or client output and check if this value |
| 748 | # is not higher than the maximum given by the first argument |
| 749 | handshake_memory_check() { |
| 750 | MAX_MEMORY="$1" |
| 751 | OUTPUT_FILE="$2" |
| 752 | |
| 753 | # Get memory usage |
| 754 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 755 | return 1 |
| 756 | fi |
| 757 | |
| 758 | # Check if memory usage is below max value |
| 759 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 760 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 761 | "but should be below $MAX_MEMORY bytes" |
| 762 | return 1 |
| 763 | else |
| 764 | return 0 |
| 765 | fi |
| 766 | } |
| 767 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 768 | # wait for client to terminate and set CLI_EXIT |
| 769 | # must be called right after starting the client |
| 770 | wait_client_done() { |
| 771 | CLI_PID=$! |
| 772 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 773 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 774 | CLI_DELAY_FACTOR=1 |
| 775 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 776 | ( 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] | 777 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 778 | |
| 779 | wait $CLI_PID |
| 780 | CLI_EXIT=$? |
| 781 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 782 | kill $DOG_PID >/dev/null 2>&1 |
| 783 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 784 | |
| 785 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 786 | |
| 787 | sleep $SRV_DELAY_SECONDS |
| 788 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 789 | } |
| 790 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 791 | # check if the given command uses dtls and sets global variable DTLS |
| 792 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 793 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 794 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 795 | *) DTLS=0;; |
| 796 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 797 | } |
| 798 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 799 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 800 | is_gnutls() { |
| 801 | case "$1" in |
| 802 | *gnutls-cli*) |
| 803 | CMD_IS_GNUTLS=1 |
| 804 | ;; |
| 805 | *gnutls-serv*) |
| 806 | CMD_IS_GNUTLS=1 |
| 807 | ;; |
| 808 | *) |
| 809 | CMD_IS_GNUTLS=0 |
| 810 | ;; |
| 811 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 812 | } |
| 813 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 814 | # Compare file content |
| 815 | # Usage: find_in_both pattern file1 file2 |
| 816 | # extract from file1 the first line matching the pattern |
| 817 | # check in file2 that the same line can be found |
| 818 | find_in_both() { |
| 819 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 820 | if [ -z "$srv_pattern" ]; then |
| 821 | return 1; |
| 822 | fi |
| 823 | |
| 824 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 825 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 826 | else |
| 827 | return 1; |
| 828 | fi |
| 829 | } |
| 830 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 831 | SKIP_HANDSHAKE_CHECK="NO" |
| 832 | skip_handshake_stage_check() { |
| 833 | SKIP_HANDSHAKE_CHECK="YES" |
| 834 | } |
| 835 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 836 | # Analyze the commands that will be used in a test. |
| 837 | # |
| 838 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 839 | # extra arguments or go through wrappers. |
| 840 | # Set $DTLS (0=TLS, 1=DTLS). |
| 841 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 842 | # update DTLS variable |
| 843 | detect_dtls "$SRV_CMD" |
| 844 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 845 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 846 | # 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] | 847 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 848 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 849 | case " $SRV_CMD " in |
| 850 | *' server_addr=::1 '*) |
| 851 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 852 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 853 | fi |
| 854 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 855 | # update CMD_IS_GNUTLS variable |
| 856 | is_gnutls "$SRV_CMD" |
| 857 | |
| 858 | # if the server uses gnutls but doesn't set priority, explicitly |
| 859 | # set the default priority |
| 860 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 861 | case "$SRV_CMD" in |
| 862 | *--priority*) :;; |
| 863 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 864 | esac |
| 865 | fi |
| 866 | |
| 867 | # update CMD_IS_GNUTLS variable |
| 868 | is_gnutls "$CLI_CMD" |
| 869 | |
| 870 | # if the client uses gnutls but doesn't set priority, explicitly |
| 871 | # set the default priority |
| 872 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 873 | case "$CLI_CMD" in |
| 874 | *--priority*) :;; |
| 875 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 876 | esac |
| 877 | fi |
| 878 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 879 | # fix client port |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 880 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 881 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 882 | else |
| 883 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 884 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 885 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 886 | # prepend valgrind to our commands if active |
| 887 | if [ "$MEMCHECK" -gt 0 ]; then |
| 888 | if is_polar "$SRV_CMD"; then |
| 889 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 890 | fi |
| 891 | if is_polar "$CLI_CMD"; then |
| 892 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 893 | fi |
| 894 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 895 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 896 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 897 | # Check for failure conditions after a test case. |
| 898 | # |
| 899 | # Inputs from run_test: |
| 900 | # * positional parameters: test options (see run_test documentation) |
| 901 | # * $CLI_EXIT: client return code |
| 902 | # * $CLI_EXPECT: expected client return code |
| 903 | # * $SRV_RET: server return code |
| 904 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 905 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 906 | # |
| 907 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 908 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 909 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 910 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 911 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 912 | if [ $TIMES_LEFT -gt 0 ] && |
| 913 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 914 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 915 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 916 | return |
| 917 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 918 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 919 | # 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] | 920 | # (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] | 921 | # expected client exit to incorrectly succeed in case of catastrophic |
| 922 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 923 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 924 | then |
| 925 | if is_polar "$SRV_CMD"; then |
| 926 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 927 | else |
| 928 | fail "server or client failed to reach handshake stage" |
| 929 | return |
| 930 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 931 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 932 | if is_polar "$CLI_CMD"; then |
| 933 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 934 | else |
| 935 | fail "server or client failed to reach handshake stage" |
| 936 | return |
| 937 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 938 | fi |
| 939 | fi |
| 940 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 941 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 942 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 943 | # exit with status 0 when interrupted by a signal, and we don't really |
| 944 | # care anyway), in case e.g. the server reports a memory leak. |
| 945 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 946 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 947 | return |
| 948 | fi |
| 949 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 950 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 951 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 952 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 953 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 954 | 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] | 955 | return |
| 956 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 957 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 958 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 959 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 960 | # 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] | 961 | while [ $# -gt 0 ] |
| 962 | do |
| 963 | case $1 in |
| 964 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 965 | 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] | 966 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 967 | return |
| 968 | fi |
| 969 | ;; |
| 970 | |
| 971 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 972 | 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] | 973 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 974 | return |
| 975 | fi |
| 976 | ;; |
| 977 | |
| 978 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 979 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 980 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 981 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 982 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 983 | return |
| 984 | fi |
| 985 | ;; |
| 986 | |
| 987 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 988 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 989 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 990 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 991 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 992 | return |
| 993 | fi |
| 994 | ;; |
| 995 | |
| 996 | # The filtering in the following two options (-u and -U) do the following |
| 997 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 998 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 999 | # - keep one of each non-unique line |
| 1000 | # - count how many lines remain |
| 1001 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1002 | # if there were no duplicates. |
| 1003 | "-U") |
| 1004 | 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 |
| 1005 | fail "lines following pattern '$2' must be unique in Server output" |
| 1006 | return |
| 1007 | fi |
| 1008 | ;; |
| 1009 | |
| 1010 | "-u") |
| 1011 | 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 |
| 1012 | 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] | 1013 | return |
| 1014 | fi |
| 1015 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1016 | "-F") |
| 1017 | if ! $2 "$SRV_OUT"; then |
| 1018 | fail "function call to '$2' failed on Server output" |
| 1019 | return |
| 1020 | fi |
| 1021 | ;; |
| 1022 | "-f") |
| 1023 | if ! $2 "$CLI_OUT"; then |
| 1024 | fail "function call to '$2' failed on Client output" |
| 1025 | return |
| 1026 | fi |
| 1027 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1028 | "-g") |
| 1029 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1030 | fail "function call to '$2' failed on Server and Client output" |
| 1031 | return |
| 1032 | fi |
| 1033 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1034 | |
| 1035 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1036 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1037 | exit 1 |
| 1038 | esac |
| 1039 | shift 2 |
| 1040 | done |
| 1041 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1042 | # check valgrind's results |
| 1043 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1044 | 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] | 1045 | fail "Server has memory errors" |
| 1046 | return |
| 1047 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1048 | 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] | 1049 | fail "Client has memory errors" |
| 1050 | return |
| 1051 | fi |
| 1052 | fi |
| 1053 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1054 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1055 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1056 | } |
| 1057 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1058 | # Run the current test case: start the server and if applicable the proxy, run |
| 1059 | # the client, wait for all processes to finish or time out. |
| 1060 | # |
| 1061 | # Inputs: |
| 1062 | # * $NAME: test case name |
| 1063 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1064 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1065 | # |
| 1066 | # Outputs: |
| 1067 | # * $CLI_EXIT: client return code |
| 1068 | # * $SRV_RET: server return code |
| 1069 | do_run_test_once() { |
| 1070 | # run the commands |
| 1071 | if [ -n "$PXY_CMD" ]; then |
| 1072 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1073 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1074 | PXY_PID=$! |
| 1075 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1076 | fi |
| 1077 | |
| 1078 | check_osrv_dtls |
| 1079 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1080 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1081 | SRV_PID=$! |
| 1082 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1083 | |
| 1084 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1085 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1086 | wait_client_done |
| 1087 | |
| 1088 | sleep 0.05 |
| 1089 | |
| 1090 | # terminate the server (and the proxy) |
| 1091 | kill $SRV_PID |
| 1092 | wait $SRV_PID |
| 1093 | SRV_RET=$? |
| 1094 | |
| 1095 | if [ -n "$PXY_CMD" ]; then |
| 1096 | kill $PXY_PID >/dev/null 2>&1 |
| 1097 | wait $PXY_PID |
| 1098 | fi |
| 1099 | } |
| 1100 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1101 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1102 | # Options: -s pattern pattern that must be present in server output |
| 1103 | # -c pattern pattern that must be present in client output |
| 1104 | # -u pattern lines after pattern must be unique in client output |
| 1105 | # -f call shell function on client output |
| 1106 | # -S pattern pattern that must be absent in server output |
| 1107 | # -C pattern pattern that must be absent in client output |
| 1108 | # -U pattern lines after pattern must be unique in server output |
| 1109 | # -F call shell function on server output |
| 1110 | # -g call shell function on server and client output |
| 1111 | run_test() { |
| 1112 | NAME="$1" |
| 1113 | shift 1 |
| 1114 | |
| 1115 | if is_excluded "$NAME"; then |
| 1116 | SKIP_NEXT="NO" |
| 1117 | # There was no request to run the test, so don't record its outcome. |
| 1118 | return |
| 1119 | fi |
| 1120 | |
| 1121 | print_name "$NAME" |
| 1122 | |
| 1123 | # Do we only run numbered tests? |
| 1124 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1125 | case ",$RUN_TEST_NUMBER," in |
| 1126 | *",$TESTS,"*) :;; |
| 1127 | *) SKIP_NEXT="YES";; |
| 1128 | esac |
| 1129 | fi |
| 1130 | |
| 1131 | # does this test use a proxy? |
| 1132 | if [ "X$1" = "X-p" ]; then |
| 1133 | PXY_CMD="$2" |
| 1134 | shift 2 |
| 1135 | else |
| 1136 | PXY_CMD="" |
| 1137 | fi |
| 1138 | |
| 1139 | # get commands and client output |
| 1140 | SRV_CMD="$1" |
| 1141 | CLI_CMD="$2" |
| 1142 | CLI_EXPECT="$3" |
| 1143 | shift 3 |
| 1144 | |
| 1145 | # Check if test uses files |
| 1146 | case "$SRV_CMD $CLI_CMD" in |
| 1147 | *data_files/*) |
| 1148 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1149 | esac |
| 1150 | |
| 1151 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1152 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1153 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1154 | |
| 1155 | # should we skip? |
| 1156 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1157 | SKIP_NEXT="NO" |
| 1158 | record_outcome "SKIP" |
| 1159 | SKIPS=$(( $SKIPS + 1 )) |
| 1160 | return |
| 1161 | fi |
| 1162 | |
| 1163 | analyze_test_commands "$@" |
| 1164 | |
| 1165 | TIMES_LEFT=2 |
| 1166 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1167 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1168 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1169 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1170 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1171 | check_test_failure "$@" |
| 1172 | case $outcome in |
| 1173 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1174 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1175 | FAIL) return;; |
| 1176 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1177 | done |
| 1178 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1179 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1180 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1181 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1182 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1183 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1184 | if [ -n "$PXY_CMD" ]; then |
| 1185 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1186 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1187 | fi |
| 1188 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1189 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1190 | } |
| 1191 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1192 | run_test_psa() { |
| 1193 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1194 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1195 | "$P_SRV debug_level=3 force_version=tls12" \ |
| 1196 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1197 | 0 \ |
| 1198 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1199 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1200 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1201 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1202 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1203 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1204 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1205 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1206 | -C "Failed to setup PSA-based cipher context"\ |
| 1207 | -S "Failed to setup PSA-based cipher context"\ |
| 1208 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1209 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1210 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1211 | -S "error" \ |
| 1212 | -C "error" |
| 1213 | } |
| 1214 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1215 | run_test_psa_force_curve() { |
| 1216 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1217 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1218 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
| 1219 | "$P_CLI debug_level=4 force_version=tls12 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1220 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1221 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1222 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1223 | -c "PSA calc verify" \ |
| 1224 | -c "calc PSA finished" \ |
| 1225 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1226 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1227 | -s "PSA calc verify" \ |
| 1228 | -s "calc PSA finished" \ |
| 1229 | -C "Failed to setup PSA-based cipher context"\ |
| 1230 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1231 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1232 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1233 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1234 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1235 | -C "error" |
| 1236 | } |
| 1237 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1238 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1239 | # a maximum fragment length. |
| 1240 | # first argument ($1) is MFL for SSL client |
| 1241 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1242 | run_test_memory_after_hanshake_with_mfl() |
| 1243 | { |
| 1244 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1245 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1246 | |
| 1247 | # Leave some margin for robustness |
| 1248 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1249 | |
| 1250 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1251 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1252 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1253 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1254 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1255 | 0 \ |
| 1256 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1257 | } |
| 1258 | |
| 1259 | |
| 1260 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1261 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1262 | run_tests_memory_after_hanshake() |
| 1263 | { |
| 1264 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1265 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1266 | |
| 1267 | # first test with default MFU is to get reference memory usage |
| 1268 | MEMORY_USAGE_MFL_16K=0 |
| 1269 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1270 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1271 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1272 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1273 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1274 | 0 \ |
| 1275 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1276 | |
| 1277 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1278 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1279 | |
| 1280 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1281 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1282 | |
| 1283 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1284 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1285 | |
| 1286 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1287 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1288 | } |
| 1289 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1290 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1291 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1292 | rm -f context_srv.txt |
| 1293 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1294 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1295 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1296 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1297 | 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] | 1298 | exit 1 |
| 1299 | } |
| 1300 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1301 | # |
| 1302 | # MAIN |
| 1303 | # |
| 1304 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1305 | get_options "$@" |
| 1306 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1307 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1308 | # patterns rather than regular expressions, use a case statement instead |
| 1309 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1310 | # detects simple cases: plain substring, everything, nothing. |
| 1311 | # |
| 1312 | # As an exception, the character '.' is treated as an ordinary character |
| 1313 | # if it is the only special character in the string. This is because it's |
| 1314 | # rare to need "any one character", but needing a literal '.' is common |
| 1315 | # (e.g. '-f "DTLS 1.2"'). |
| 1316 | need_grep= |
| 1317 | case "$FILTER" in |
| 1318 | '^$') simple_filter=;; |
| 1319 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1320 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1321 | need_grep=1;; |
| 1322 | *) # No regexp or shell-pattern special character |
| 1323 | simple_filter="*$FILTER*";; |
| 1324 | esac |
| 1325 | case "$EXCLUDE" in |
| 1326 | '^$') simple_exclude=;; |
| 1327 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1328 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1329 | need_grep=1;; |
| 1330 | *) # No regexp or shell-pattern special character |
| 1331 | simple_exclude="*$EXCLUDE*";; |
| 1332 | esac |
| 1333 | if [ -n "$need_grep" ]; then |
| 1334 | is_excluded () { |
| 1335 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1336 | } |
| 1337 | else |
| 1338 | is_excluded () { |
| 1339 | case "$1" in |
| 1340 | $simple_exclude) true;; |
| 1341 | $simple_filter) false;; |
| 1342 | *) true;; |
| 1343 | esac |
| 1344 | } |
| 1345 | fi |
| 1346 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1347 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1348 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1349 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1350 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1351 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1352 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1353 | exit 1 |
| 1354 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1355 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1356 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1357 | exit 1 |
| 1358 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1359 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1360 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1361 | exit 1 |
| 1362 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1363 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1364 | if which valgrind >/dev/null 2>&1; then :; else |
| 1365 | echo "Memcheck not possible. Valgrind not found" |
| 1366 | exit 1 |
| 1367 | fi |
| 1368 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1369 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1370 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1371 | exit 1 |
| 1372 | fi |
| 1373 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1374 | # used by watchdog |
| 1375 | MAIN_PID="$$" |
| 1376 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1377 | # We use somewhat arbitrary delays for tests: |
| 1378 | # - how long do we wait for the server to start (when lsof not available)? |
| 1379 | # - how long do we allow for the client to finish? |
| 1380 | # (not to check performance, just to avoid waiting indefinitely) |
| 1381 | # Things are slower with valgrind, so give extra time here. |
| 1382 | # |
| 1383 | # Note: without lsof, there is a trade-off between the running time of this |
| 1384 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1385 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1386 | # 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] | 1387 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1388 | START_DELAY=6 |
| 1389 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1390 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1391 | START_DELAY=2 |
| 1392 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1393 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1394 | |
| 1395 | # some particular tests need more time: |
| 1396 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1397 | # - for the server, we sleep for a number of seconds after the client exits |
| 1398 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1399 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1400 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1401 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1402 | # 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] | 1403 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1404 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1405 | # machines that will resolve to ::1, and we don't want ipv6 here. |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1406 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1407 | 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] | 1408 | 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] | 1409 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1410 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1411 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1412 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1413 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1414 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1415 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1416 | O_LEGACY_CLI="$O_LEGACY_CLI -connect 127.0.0.1:+SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1417 | fi |
| 1418 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1419 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1420 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1421 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1422 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1423 | fi |
| 1424 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1425 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1426 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1427 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1428 | fi |
| 1429 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1430 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1431 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1432 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1433 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1434 | # Allow SHA-1, because many of our test certificates use it |
| 1435 | P_SRV="$P_SRV allow_sha1=1" |
| 1436 | P_CLI="$P_CLI allow_sha1=1" |
| 1437 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1438 | # Also pick a unique name for intermediate files |
| 1439 | SRV_OUT="srv_out.$$" |
| 1440 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1441 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1442 | SESSION="session.$$" |
| 1443 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1444 | SKIP_NEXT="NO" |
| 1445 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1446 | trap cleanup INT TERM HUP |
| 1447 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1448 | # Basic test |
| 1449 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1450 | # Checks that: |
| 1451 | # - 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] | 1452 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1453 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1454 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1455 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1456 | "$P_CLI" \ |
| 1457 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1458 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1459 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1460 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1461 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1462 | -S "error" \ |
| 1463 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1464 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1465 | run_test "Default, DTLS" \ |
| 1466 | "$P_SRV dtls=1" \ |
| 1467 | "$P_CLI dtls=1" \ |
| 1468 | 0 \ |
| 1469 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1470 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1471 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1472 | run_test "TLS client auth: required" \ |
| 1473 | "$P_SRV auth_mode=required" \ |
| 1474 | "$P_CLI" \ |
| 1475 | 0 \ |
| 1476 | -s "Verifying peer X.509 certificate... ok" |
| 1477 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1478 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1479 | "$P_SRV" \ |
| 1480 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1481 | 0 \ |
| 1482 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1483 | -c "Key size is 256" |
| 1484 | |
| 1485 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1486 | "$P_SRV" \ |
| 1487 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1488 | 0 \ |
| 1489 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1490 | -c "Key size is 128" |
| 1491 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1492 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1493 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1494 | requires_config_enabled MBEDTLS_SHA256_C |
| 1495 | run_test "TLS: password protected client key" \ |
| 1496 | "$P_SRV auth_mode=required" \ |
| 1497 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1498 | 0 |
| 1499 | |
| 1500 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1501 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1502 | requires_config_enabled MBEDTLS_SHA256_C |
| 1503 | run_test "TLS: password protected server key" \ |
| 1504 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1505 | "$P_CLI" \ |
| 1506 | 0 |
| 1507 | |
| 1508 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1509 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1510 | requires_config_enabled MBEDTLS_RSA_C |
| 1511 | requires_config_enabled MBEDTLS_SHA256_C |
| 1512 | run_test "TLS: password protected server key, two certificates" \ |
| 1513 | "$P_SRV \ |
| 1514 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1515 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1516 | "$P_CLI" \ |
| 1517 | 0 |
| 1518 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1519 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1520 | run_test "CA callback on client" \ |
| 1521 | "$P_SRV debug_level=3" \ |
| 1522 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1523 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1524 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1525 | -S "error" \ |
| 1526 | -C "error" |
| 1527 | |
| 1528 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1529 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1530 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1531 | requires_config_enabled MBEDTLS_SHA256_C |
| 1532 | run_test "CA callback on server" \ |
| 1533 | "$P_SRV auth_mode=required" \ |
| 1534 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1535 | key_file=data_files/server5.key" \ |
| 1536 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1537 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1538 | -s "Verifying peer X.509 certificate... ok" \ |
| 1539 | -S "error" \ |
| 1540 | -C "error" |
| 1541 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1542 | # Test using an opaque private key for client authentication |
| 1543 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1544 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1545 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1546 | requires_config_enabled MBEDTLS_SHA256_C |
| 1547 | run_test "Opaque key for client authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1548 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1549 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1550 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1551 | key_file=data_files/server5.key" \ |
| 1552 | 0 \ |
| 1553 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1554 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1555 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1556 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1557 | -S "error" \ |
| 1558 | -C "error" |
| 1559 | |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1560 | # Test using an opaque private key for server authentication |
| 1561 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1562 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1563 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1564 | requires_config_enabled MBEDTLS_SHA256_C |
| 1565 | run_test "Opaque key for server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1566 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1567 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1568 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1569 | key_file=data_files/server5.key" \ |
| 1570 | 0 \ |
| 1571 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1572 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 1573 | -s "key types: Opaque - invalid PK" \ |
| 1574 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1575 | -S "error" \ |
| 1576 | -C "error" |
| 1577 | |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1578 | # Test using an opaque private key for client/server authentication |
| 1579 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1580 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1581 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1582 | requires_config_enabled MBEDTLS_SHA256_C |
| 1583 | run_test "Opaque key for client/server authentication" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1584 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 1585 | key_file=data_files/server5.key" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1586 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1587 | key_file=data_files/server5.key" \ |
| 1588 | 0 \ |
| 1589 | -c "key type: Opaque" \ |
| 1590 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1591 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 1592 | -s "key types: Opaque - invalid PK" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 1593 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1594 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1595 | -S "error" \ |
| 1596 | -C "error" |
| 1597 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1598 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1599 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1600 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1601 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1602 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1603 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1604 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1605 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1606 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1607 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1608 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1609 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1610 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1611 | run_test_psa_force_curve "secp521r1" |
| 1612 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1613 | run_test_psa_force_curve "brainpoolP512r1" |
| 1614 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1615 | run_test_psa_force_curve "secp384r1" |
| 1616 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1617 | run_test_psa_force_curve "brainpoolP384r1" |
| 1618 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1619 | run_test_psa_force_curve "secp256r1" |
| 1620 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1621 | run_test_psa_force_curve "secp256k1" |
| 1622 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1623 | run_test_psa_force_curve "brainpoolP256r1" |
| 1624 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1625 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1626 | ## SECP224K1 is buggy via the PSA API |
| 1627 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1628 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1629 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1630 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1631 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1632 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1633 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1634 | run_test_psa_force_curve "secp192r1" |
| 1635 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1636 | run_test_psa_force_curve "secp192k1" |
| 1637 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1638 | # Test current time in ServerHello |
| 1639 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 1640 | run_test "ServerHello contains gmt_unix_time" \ |
| 1641 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1642 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1643 | 0 \ |
| 1644 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1645 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1646 | |
| 1647 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1648 | run_test "Unique IV in GCM" \ |
| 1649 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1650 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1651 | 0 \ |
| 1652 | -u "IV used" \ |
| 1653 | -U "IV used" |
| 1654 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1655 | # Tests for certificate verification callback |
| 1656 | run_test "Configuration-specific CRT verification callback" \ |
| 1657 | "$P_SRV debug_level=3" \ |
| 1658 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1659 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1660 | -S "error" \ |
| 1661 | -c "Verify requested for " \ |
| 1662 | -c "Use configuration-specific verification callback" \ |
| 1663 | -C "Use context-specific verification callback" \ |
| 1664 | -C "error" |
| 1665 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1666 | run_test "Context-specific CRT verification callback" \ |
| 1667 | "$P_SRV debug_level=3" \ |
| 1668 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1669 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1670 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1671 | -c "Verify requested for " \ |
| 1672 | -c "Use context-specific verification callback" \ |
| 1673 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1674 | -C "error" |
| 1675 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1676 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1677 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1678 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1679 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1680 | 1 \ |
| 1681 | -c "The certificate is signed with an unacceptable hash" |
| 1682 | |
| 1683 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1684 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1685 | "$P_CLI allow_sha1=1" \ |
| 1686 | 0 |
| 1687 | |
| 1688 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1689 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1690 | "$P_CLI allow_sha1=0" \ |
| 1691 | 0 |
| 1692 | |
| 1693 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1694 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1695 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1696 | 1 \ |
| 1697 | -s "The certificate is signed with an unacceptable hash" |
| 1698 | |
| 1699 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1700 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1701 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1702 | 0 |
| 1703 | |
| 1704 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1705 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1706 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1707 | 0 |
| 1708 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1709 | # Dummy TLS 1.3 test |
| 1710 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1711 | # ssl_client2/ssl_server2 example programs works. |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1713 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1714 | "$P_SRV tls13_kex_modes=psk" \ |
| 1715 | "$P_CLI tls13_kex_modes=psk" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1716 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1717 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1718 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1719 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1720 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1721 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1723 | run_test "TLS 1.3, key exchange mode parameter passing: Pure-ephemeral only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1724 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1725 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1726 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1728 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1729 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1730 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1731 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1732 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1733 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1734 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1735 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1736 | 0 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 1737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1738 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1739 | "$P_SRV tls13_kex_modes=all" \ |
| 1740 | "$P_CLI tls13_kex_modes=all" \ |
| 1741 | 0 |
| 1742 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1743 | # Tests for datagram packing |
| 1744 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1745 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1746 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1747 | 0 \ |
| 1748 | -c "next record in same datagram" \ |
| 1749 | -s "next record in same datagram" |
| 1750 | |
| 1751 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1752 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1753 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1754 | 0 \ |
| 1755 | -s "next record in same datagram" \ |
| 1756 | -C "next record in same datagram" |
| 1757 | |
| 1758 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1759 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1760 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1761 | 0 \ |
| 1762 | -S "next record in same datagram" \ |
| 1763 | -c "next record in same datagram" |
| 1764 | |
| 1765 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1766 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1767 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1768 | 0 \ |
| 1769 | -S "next record in same datagram" \ |
| 1770 | -C "next record in same datagram" |
| 1771 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1772 | # Tests for Context serialization |
| 1773 | |
| 1774 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1775 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1776 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1777 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1778 | 0 \ |
| 1779 | -c "Deserializing connection..." \ |
| 1780 | -S "Deserializing connection..." |
| 1781 | |
| 1782 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1783 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1784 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1785 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1786 | 0 \ |
| 1787 | -c "Deserializing connection..." \ |
| 1788 | -S "Deserializing connection..." |
| 1789 | |
| 1790 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1791 | run_test "Context serialization, client serializes, GCM" \ |
| 1792 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1793 | "$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] | 1794 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1795 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1796 | -S "Deserializing connection..." |
| 1797 | |
| 1798 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1799 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1800 | run_test "Context serialization, client serializes, with CID" \ |
| 1801 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1802 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1803 | 0 \ |
| 1804 | -c "Deserializing connection..." \ |
| 1805 | -S "Deserializing connection..." |
| 1806 | |
| 1807 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1808 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1809 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1810 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1811 | 0 \ |
| 1812 | -C "Deserializing connection..." \ |
| 1813 | -s "Deserializing connection..." |
| 1814 | |
| 1815 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1816 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1817 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1818 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1819 | 0 \ |
| 1820 | -C "Deserializing connection..." \ |
| 1821 | -s "Deserializing connection..." |
| 1822 | |
| 1823 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1824 | run_test "Context serialization, server serializes, GCM" \ |
| 1825 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1826 | "$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] | 1827 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1828 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1829 | -s "Deserializing connection..." |
| 1830 | |
| 1831 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1832 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1833 | run_test "Context serialization, server serializes, with CID" \ |
| 1834 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1835 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1836 | 0 \ |
| 1837 | -C "Deserializing connection..." \ |
| 1838 | -s "Deserializing connection..." |
| 1839 | |
| 1840 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1841 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1842 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1843 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1844 | 0 \ |
| 1845 | -c "Deserializing connection..." \ |
| 1846 | -s "Deserializing connection..." |
| 1847 | |
| 1848 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1849 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1850 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1851 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1852 | 0 \ |
| 1853 | -c "Deserializing connection..." \ |
| 1854 | -s "Deserializing connection..." |
| 1855 | |
| 1856 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1857 | run_test "Context serialization, both serialize, GCM" \ |
| 1858 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1859 | "$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] | 1860 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1861 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1862 | -s "Deserializing connection..." |
| 1863 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1864 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1865 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1866 | run_test "Context serialization, both serialize, with CID" \ |
| 1867 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1868 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1869 | 0 \ |
| 1870 | -c "Deserializing connection..." \ |
| 1871 | -s "Deserializing connection..." |
| 1872 | |
| 1873 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1874 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1875 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1876 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1877 | 0 \ |
| 1878 | -c "Deserializing connection..." \ |
| 1879 | -S "Deserializing connection..." |
| 1880 | |
| 1881 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1882 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1883 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1884 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1885 | 0 \ |
| 1886 | -c "Deserializing connection..." \ |
| 1887 | -S "Deserializing connection..." |
| 1888 | |
| 1889 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1890 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1891 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1892 | "$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] | 1893 | 0 \ |
| 1894 | -c "Deserializing connection..." \ |
| 1895 | -S "Deserializing connection..." |
| 1896 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1897 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1898 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1899 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1900 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1901 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1902 | 0 \ |
| 1903 | -c "Deserializing connection..." \ |
| 1904 | -S "Deserializing connection..." |
| 1905 | |
| 1906 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1907 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1908 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1909 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1910 | 0 \ |
| 1911 | -C "Deserializing connection..." \ |
| 1912 | -s "Deserializing connection..." |
| 1913 | |
| 1914 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1915 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1916 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1917 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1918 | 0 \ |
| 1919 | -C "Deserializing connection..." \ |
| 1920 | -s "Deserializing connection..." |
| 1921 | |
| 1922 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1923 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1924 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1925 | "$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] | 1926 | 0 \ |
| 1927 | -C "Deserializing connection..." \ |
| 1928 | -s "Deserializing connection..." |
| 1929 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1930 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1931 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1932 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1933 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1934 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1935 | 0 \ |
| 1936 | -C "Deserializing connection..." \ |
| 1937 | -s "Deserializing connection..." |
| 1938 | |
| 1939 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1940 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1941 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1942 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1943 | 0 \ |
| 1944 | -c "Deserializing connection..." \ |
| 1945 | -s "Deserializing connection..." |
| 1946 | |
| 1947 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1948 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1949 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1950 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1951 | 0 \ |
| 1952 | -c "Deserializing connection..." \ |
| 1953 | -s "Deserializing connection..." |
| 1954 | |
| 1955 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1956 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1957 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1958 | "$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] | 1959 | 0 \ |
| 1960 | -c "Deserializing connection..." \ |
| 1961 | -s "Deserializing connection..." |
| 1962 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1963 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1964 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1965 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1966 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1967 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1968 | 0 \ |
| 1969 | -c "Deserializing connection..." \ |
| 1970 | -s "Deserializing connection..." |
| 1971 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1972 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1973 | run_test "Saving the serialized context to a file" \ |
| 1974 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1975 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1976 | 0 \ |
| 1977 | -s "Save serialized context to a file... ok" \ |
| 1978 | -c "Save serialized context to a file... ok" |
| 1979 | rm -f context_srv.txt |
| 1980 | rm -f context_cli.txt |
| 1981 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1982 | # Tests for DTLS Connection ID extension |
| 1983 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1984 | # So far, the CID API isn't implemented, so we can't |
| 1985 | # grep for output witnessing its use. This needs to be |
| 1986 | # changed once the CID extension is implemented. |
| 1987 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1988 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1989 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1990 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1991 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1992 | 0 \ |
| 1993 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1994 | -s "found CID extension" \ |
| 1995 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1996 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1997 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1998 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1999 | -C "found CID extension" \ |
| 2000 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2001 | -C "Copy CIDs into SSL transform" \ |
| 2002 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2003 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2004 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2005 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2006 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2007 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2008 | 0 \ |
| 2009 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2010 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2011 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2012 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2013 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2014 | -C "found CID extension" \ |
| 2015 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2016 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2017 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2018 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2019 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2020 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2021 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2022 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2023 | 0 \ |
| 2024 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2025 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2026 | -c "client hello, adding CID extension" \ |
| 2027 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2028 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2029 | -s "server hello, adding CID extension" \ |
| 2030 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2031 | -c "Use of CID extension negotiated" \ |
| 2032 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2033 | -c "Copy CIDs into SSL transform" \ |
| 2034 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2035 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2036 | -s "Use of Connection ID has been negotiated" \ |
| 2037 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2038 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2039 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2040 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2041 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2042 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2043 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2044 | 0 \ |
| 2045 | -c "Enable use of CID extension." \ |
| 2046 | -s "Enable use of CID extension." \ |
| 2047 | -c "client hello, adding CID extension" \ |
| 2048 | -s "found CID extension" \ |
| 2049 | -s "Use of CID extension negotiated" \ |
| 2050 | -s "server hello, adding CID extension" \ |
| 2051 | -c "found CID extension" \ |
| 2052 | -c "Use of CID extension negotiated" \ |
| 2053 | -s "Copy CIDs into SSL transform" \ |
| 2054 | -c "Copy CIDs into SSL transform" \ |
| 2055 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2056 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2057 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2058 | -c "Use of Connection ID has been negotiated" \ |
| 2059 | -c "ignoring unexpected CID" \ |
| 2060 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2061 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2062 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2063 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2064 | -p "$P_PXY mtu=800" \ |
| 2065 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2066 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2067 | 0 \ |
| 2068 | -c "Enable use of CID extension." \ |
| 2069 | -s "Enable use of CID extension." \ |
| 2070 | -c "client hello, adding CID extension" \ |
| 2071 | -s "found CID extension" \ |
| 2072 | -s "Use of CID extension negotiated" \ |
| 2073 | -s "server hello, adding CID extension" \ |
| 2074 | -c "found CID extension" \ |
| 2075 | -c "Use of CID extension negotiated" \ |
| 2076 | -s "Copy CIDs into SSL transform" \ |
| 2077 | -c "Copy CIDs into SSL transform" \ |
| 2078 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2079 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2080 | -s "Use of Connection ID has been negotiated" \ |
| 2081 | -c "Use of Connection ID has been negotiated" |
| 2082 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2083 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2084 | 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] | 2085 | -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] | 2086 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2087 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2088 | 0 \ |
| 2089 | -c "Enable use of CID extension." \ |
| 2090 | -s "Enable use of CID extension." \ |
| 2091 | -c "client hello, adding CID extension" \ |
| 2092 | -s "found CID extension" \ |
| 2093 | -s "Use of CID extension negotiated" \ |
| 2094 | -s "server hello, adding CID extension" \ |
| 2095 | -c "found CID extension" \ |
| 2096 | -c "Use of CID extension negotiated" \ |
| 2097 | -s "Copy CIDs into SSL transform" \ |
| 2098 | -c "Copy CIDs into SSL transform" \ |
| 2099 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2100 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2101 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2102 | -c "Use of Connection ID has been negotiated" \ |
| 2103 | -c "ignoring unexpected CID" \ |
| 2104 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2105 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2106 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2107 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2108 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2109 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2110 | 0 \ |
| 2111 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2112 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2113 | -c "client hello, adding CID extension" \ |
| 2114 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2115 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2116 | -s "server hello, adding CID extension" \ |
| 2117 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2118 | -c "Use of CID extension negotiated" \ |
| 2119 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2120 | -c "Copy CIDs into SSL transform" \ |
| 2121 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2122 | -s "Peer CID (length 0 Bytes):" \ |
| 2123 | -s "Use of Connection ID has been negotiated" \ |
| 2124 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2125 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2126 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2127 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2128 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2129 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2130 | 0 \ |
| 2131 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2132 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2133 | -c "client hello, adding CID extension" \ |
| 2134 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2135 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2136 | -s "server hello, adding CID extension" \ |
| 2137 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2138 | -c "Use of CID extension negotiated" \ |
| 2139 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2140 | -c "Copy CIDs into SSL transform" \ |
| 2141 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2142 | -c "Peer CID (length 0 Bytes):" \ |
| 2143 | -s "Use of Connection ID has been negotiated" \ |
| 2144 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2145 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2146 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2147 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2148 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2149 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2150 | 0 \ |
| 2151 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2152 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2153 | -c "client hello, adding CID extension" \ |
| 2154 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2155 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2156 | -s "server hello, adding CID extension" \ |
| 2157 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2158 | -c "Use of CID extension negotiated" \ |
| 2159 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2160 | -c "Copy CIDs into SSL transform" \ |
| 2161 | -S "Use of Connection ID has been negotiated" \ |
| 2162 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2163 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2164 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2165 | 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] | 2166 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2167 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2168 | 0 \ |
| 2169 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2170 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2171 | -c "client hello, adding CID extension" \ |
| 2172 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2173 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2174 | -s "server hello, adding CID extension" \ |
| 2175 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2176 | -c "Use of CID extension negotiated" \ |
| 2177 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2178 | -c "Copy CIDs into SSL transform" \ |
| 2179 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2180 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2181 | -s "Use of Connection ID has been negotiated" \ |
| 2182 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2183 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2184 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2185 | 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] | 2186 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2187 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2188 | 0 \ |
| 2189 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2190 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2191 | -c "client hello, adding CID extension" \ |
| 2192 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2193 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2194 | -s "server hello, adding CID extension" \ |
| 2195 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2196 | -c "Use of CID extension negotiated" \ |
| 2197 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2198 | -c "Copy CIDs into SSL transform" \ |
| 2199 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2200 | -s "Peer CID (length 0 Bytes):" \ |
| 2201 | -s "Use of Connection ID has been negotiated" \ |
| 2202 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2203 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2204 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2205 | 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] | 2206 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2207 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2208 | 0 \ |
| 2209 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2210 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2211 | -c "client hello, adding CID extension" \ |
| 2212 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2213 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2214 | -s "server hello, adding CID extension" \ |
| 2215 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2216 | -c "Use of CID extension negotiated" \ |
| 2217 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2218 | -c "Copy CIDs into SSL transform" \ |
| 2219 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2220 | -c "Peer CID (length 0 Bytes):" \ |
| 2221 | -s "Use of Connection ID has been negotiated" \ |
| 2222 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2223 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2224 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2225 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2226 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2227 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2228 | 0 \ |
| 2229 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2230 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2231 | -c "client hello, adding CID extension" \ |
| 2232 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2233 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2234 | -s "server hello, adding CID extension" \ |
| 2235 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2236 | -c "Use of CID extension negotiated" \ |
| 2237 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2238 | -c "Copy CIDs into SSL transform" \ |
| 2239 | -S "Use of Connection ID has been negotiated" \ |
| 2240 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2241 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2242 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2243 | 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] | 2244 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2245 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2246 | 0 \ |
| 2247 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2248 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2249 | -c "client hello, adding CID extension" \ |
| 2250 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2251 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2252 | -s "server hello, adding CID extension" \ |
| 2253 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2254 | -c "Use of CID extension negotiated" \ |
| 2255 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2256 | -c "Copy CIDs into SSL transform" \ |
| 2257 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2258 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2259 | -s "Use of Connection ID has been negotiated" \ |
| 2260 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2261 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2262 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2263 | 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] | 2264 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2265 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2266 | 0 \ |
| 2267 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2268 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2269 | -c "client hello, adding CID extension" \ |
| 2270 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2271 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2272 | -s "server hello, adding CID extension" \ |
| 2273 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2274 | -c "Use of CID extension negotiated" \ |
| 2275 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2276 | -c "Copy CIDs into SSL transform" \ |
| 2277 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2278 | -s "Peer CID (length 0 Bytes):" \ |
| 2279 | -s "Use of Connection ID has been negotiated" \ |
| 2280 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2281 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2282 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2283 | 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] | 2284 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2285 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2286 | 0 \ |
| 2287 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2288 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2289 | -c "client hello, adding CID extension" \ |
| 2290 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2291 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2292 | -s "server hello, adding CID extension" \ |
| 2293 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2294 | -c "Use of CID extension negotiated" \ |
| 2295 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2296 | -c "Copy CIDs into SSL transform" \ |
| 2297 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2298 | -c "Peer CID (length 0 Bytes):" \ |
| 2299 | -s "Use of Connection ID has been negotiated" \ |
| 2300 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2301 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2302 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2303 | 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] | 2304 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2305 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2306 | 0 \ |
| 2307 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2308 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2309 | -c "client hello, adding CID extension" \ |
| 2310 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2311 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2312 | -s "server hello, adding CID extension" \ |
| 2313 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2314 | -c "Use of CID extension negotiated" \ |
| 2315 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2316 | -c "Copy CIDs into SSL transform" \ |
| 2317 | -S "Use of Connection ID has been negotiated" \ |
| 2318 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2319 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2320 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2321 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2322 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2323 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2324 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2325 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2326 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2327 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2328 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2329 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2330 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2331 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2332 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2333 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2334 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2335 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2336 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2337 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2338 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2339 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2340 | 0 \ |
| 2341 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2342 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2343 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2344 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2345 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2346 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2347 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2348 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2349 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2350 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2351 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2352 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2353 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2354 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2355 | 0 \ |
| 2356 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2357 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2358 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2359 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2360 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2361 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2362 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2363 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2364 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2365 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2366 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2367 | 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] | 2368 | -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] | 2369 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2370 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2371 | 0 \ |
| 2372 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2373 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2374 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2375 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2376 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2377 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2378 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2379 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2380 | -c "ignoring unexpected CID" \ |
| 2381 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2382 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2383 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2384 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2385 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2386 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2387 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2388 | 0 \ |
| 2389 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2390 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2391 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2392 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2393 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2394 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2395 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2396 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2397 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2398 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2399 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2400 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2401 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2402 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2403 | 0 \ |
| 2404 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2405 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2406 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2407 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2408 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2409 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2410 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2411 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2412 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2413 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2414 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2415 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2416 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2417 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2418 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2419 | 0 \ |
| 2420 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2421 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2422 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2423 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2424 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2425 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2426 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2427 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2428 | -c "ignoring unexpected CID" \ |
| 2429 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2430 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2431 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2432 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2433 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2434 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2435 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2436 | 0 \ |
| 2437 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2438 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2439 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2440 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2441 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2442 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2443 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2444 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2445 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2446 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2447 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2448 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2449 | 0 \ |
| 2450 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2451 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2452 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2453 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2454 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2455 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2456 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2457 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2458 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2459 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2460 | -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] | 2461 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2462 | "$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" \ |
| 2463 | 0 \ |
| 2464 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2465 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2466 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2467 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2468 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2469 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2470 | -c "ignoring unexpected CID" \ |
| 2471 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2472 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2473 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2474 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2475 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2476 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2477 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2478 | 0 \ |
| 2479 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2480 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2481 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2482 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2483 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2484 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2485 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2486 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2487 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2488 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2489 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2490 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2491 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2492 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2493 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2494 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2495 | 0 \ |
| 2496 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2497 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2498 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2499 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2500 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2501 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2502 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2503 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2504 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2505 | -c "ignoring unexpected CID" \ |
| 2506 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2507 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2508 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2509 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2510 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2511 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2512 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2513 | 0 \ |
| 2514 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2515 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2516 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2517 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2518 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2519 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2520 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2521 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2522 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2523 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2524 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2525 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2526 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2527 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2528 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2529 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2530 | 0 \ |
| 2531 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2532 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2533 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2534 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2535 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2536 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2537 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2538 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2539 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2540 | -c "ignoring unexpected CID" \ |
| 2541 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2542 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2543 | # 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] | 2544 | # tests check that the buffer contents are reallocated when the message is |
| 2545 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2546 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2547 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2548 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2549 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2550 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2551 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2552 | 0 \ |
| 2553 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2554 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2555 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2556 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2557 | -s "Reallocating in_buf" \ |
| 2558 | -s "Reallocating out_buf" |
| 2559 | |
| 2560 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2561 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2562 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2563 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2564 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2565 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2566 | 0 \ |
| 2567 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2568 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2569 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2570 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2571 | -s "Reallocating in_buf" \ |
| 2572 | -s "Reallocating out_buf" |
| 2573 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2574 | # Tests for Encrypt-then-MAC extension |
| 2575 | |
| 2576 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2577 | "$P_SRV debug_level=3 \ |
| 2578 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2579 | "$P_CLI debug_level=3" \ |
| 2580 | 0 \ |
| 2581 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2582 | -s "found encrypt then mac extension" \ |
| 2583 | -s "server hello, adding encrypt then mac extension" \ |
| 2584 | -c "found encrypt_then_mac extension" \ |
| 2585 | -c "using encrypt then mac" \ |
| 2586 | -s "using encrypt then mac" |
| 2587 | |
| 2588 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2589 | "$P_SRV debug_level=3 etm=0 \ |
| 2590 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2591 | "$P_CLI debug_level=3 etm=1" \ |
| 2592 | 0 \ |
| 2593 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2594 | -s "found encrypt then mac extension" \ |
| 2595 | -S "server hello, adding encrypt then mac extension" \ |
| 2596 | -C "found encrypt_then_mac extension" \ |
| 2597 | -C "using encrypt then mac" \ |
| 2598 | -S "using encrypt then mac" |
| 2599 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2600 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2601 | "$P_SRV debug_level=3 etm=1 \ |
| 2602 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2603 | "$P_CLI debug_level=3 etm=1" \ |
| 2604 | 0 \ |
| 2605 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2606 | -s "found encrypt then mac extension" \ |
| 2607 | -S "server hello, adding encrypt then mac extension" \ |
| 2608 | -C "found encrypt_then_mac extension" \ |
| 2609 | -C "using encrypt then mac" \ |
| 2610 | -S "using encrypt then mac" |
| 2611 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2612 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2613 | "$P_SRV debug_level=3 etm=1 \ |
| 2614 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2615 | "$P_CLI debug_level=3 etm=0" \ |
| 2616 | 0 \ |
| 2617 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2618 | -S "found encrypt then mac extension" \ |
| 2619 | -S "server hello, adding encrypt then mac extension" \ |
| 2620 | -C "found encrypt_then_mac extension" \ |
| 2621 | -C "using encrypt then mac" \ |
| 2622 | -S "using encrypt then mac" |
| 2623 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2624 | # Tests for Extended Master Secret extension |
| 2625 | |
| 2626 | run_test "Extended Master Secret: default" \ |
| 2627 | "$P_SRV debug_level=3" \ |
| 2628 | "$P_CLI debug_level=3" \ |
| 2629 | 0 \ |
| 2630 | -c "client hello, adding extended_master_secret extension" \ |
| 2631 | -s "found extended master secret extension" \ |
| 2632 | -s "server hello, adding extended master secret extension" \ |
| 2633 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2634 | -c "session hash for extended master secret" \ |
| 2635 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2636 | |
| 2637 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2638 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2639 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2640 | 0 \ |
| 2641 | -c "client hello, adding extended_master_secret extension" \ |
| 2642 | -s "found extended master secret extension" \ |
| 2643 | -S "server hello, adding extended master secret extension" \ |
| 2644 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2645 | -C "session hash for extended master secret" \ |
| 2646 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2647 | |
| 2648 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2649 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2650 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2651 | 0 \ |
| 2652 | -C "client hello, adding extended_master_secret extension" \ |
| 2653 | -S "found extended master secret extension" \ |
| 2654 | -S "server hello, adding extended master secret extension" \ |
| 2655 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2656 | -C "session hash for extended master secret" \ |
| 2657 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2658 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2659 | # Test sending and receiving empty application data records |
| 2660 | |
| 2661 | run_test "Encrypt then MAC: empty application data record" \ |
| 2662 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2663 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2664 | 0 \ |
| 2665 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2666 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2667 | -c "0 bytes written in 1 fragments" |
| 2668 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2669 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2670 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2671 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2672 | 0 \ |
| 2673 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2674 | -c "0 bytes written in 1 fragments" |
| 2675 | |
| 2676 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2677 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2678 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2679 | 0 \ |
| 2680 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2681 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2682 | -c "0 bytes written in 1 fragments" |
| 2683 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2684 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2685 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2686 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2687 | 0 \ |
| 2688 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2689 | -c "0 bytes written in 1 fragments" |
| 2690 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2691 | # Tests for CBC 1/n-1 record splitting |
| 2692 | |
| 2693 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2694 | "$P_SRV" \ |
| 2695 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 2696 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2697 | 0 \ |
| 2698 | -s "Read from client: 123 bytes read" \ |
| 2699 | -S "Read from client: 1 bytes read" \ |
| 2700 | -S "122 bytes read" |
| 2701 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2702 | # Tests for Session Tickets |
| 2703 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2704 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2705 | "$P_SRV debug_level=3 tickets=1" \ |
| 2706 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2707 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2708 | -c "client hello, adding session ticket extension" \ |
| 2709 | -s "found session ticket extension" \ |
| 2710 | -s "server hello, adding session ticket extension" \ |
| 2711 | -c "found session_ticket extension" \ |
| 2712 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2713 | -S "session successfully restored from cache" \ |
| 2714 | -s "session successfully restored from ticket" \ |
| 2715 | -s "a session has been resumed" \ |
| 2716 | -c "a session has been resumed" |
| 2717 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2718 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2719 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2720 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2721 | 0 \ |
| 2722 | -c "client hello, adding session ticket extension" \ |
| 2723 | -s "found session ticket extension" \ |
| 2724 | -s "server hello, adding session ticket extension" \ |
| 2725 | -c "found session_ticket extension" \ |
| 2726 | -c "parse new session ticket" \ |
| 2727 | -S "session successfully restored from cache" \ |
| 2728 | -s "session successfully restored from ticket" \ |
| 2729 | -s "a session has been resumed" \ |
| 2730 | -c "a session has been resumed" |
| 2731 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2732 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2733 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2734 | "$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] | 2735 | 0 \ |
| 2736 | -c "client hello, adding session ticket extension" \ |
| 2737 | -s "found session ticket extension" \ |
| 2738 | -s "server hello, adding session ticket extension" \ |
| 2739 | -c "found session_ticket extension" \ |
| 2740 | -c "parse new session ticket" \ |
| 2741 | -S "session successfully restored from cache" \ |
| 2742 | -S "session successfully restored from ticket" \ |
| 2743 | -S "a session has been resumed" \ |
| 2744 | -C "a session has been resumed" |
| 2745 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2746 | run_test "Session resume using tickets: session copy" \ |
| 2747 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2748 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2749 | 0 \ |
| 2750 | -c "client hello, adding session ticket extension" \ |
| 2751 | -s "found session ticket extension" \ |
| 2752 | -s "server hello, adding session ticket extension" \ |
| 2753 | -c "found session_ticket extension" \ |
| 2754 | -c "parse new session ticket" \ |
| 2755 | -S "session successfully restored from cache" \ |
| 2756 | -s "session successfully restored from ticket" \ |
| 2757 | -s "a session has been resumed" \ |
| 2758 | -c "a session has been resumed" |
| 2759 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2760 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2761 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2762 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2763 | 0 \ |
| 2764 | -c "client hello, adding session ticket extension" \ |
| 2765 | -c "found session_ticket extension" \ |
| 2766 | -c "parse new session ticket" \ |
| 2767 | -c "a session has been resumed" |
| 2768 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2769 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2770 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2771 | "( $O_CLI -sess_out $SESSION; \ |
| 2772 | $O_CLI -sess_in $SESSION; \ |
| 2773 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2774 | 0 \ |
| 2775 | -s "found session ticket extension" \ |
| 2776 | -s "server hello, adding session ticket extension" \ |
| 2777 | -S "session successfully restored from cache" \ |
| 2778 | -s "session successfully restored from ticket" \ |
| 2779 | -s "a session has been resumed" |
| 2780 | |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 2781 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 2782 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 2783 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2784 | 0 \ |
| 2785 | -c "client hello, adding session ticket extension" \ |
| 2786 | -s "found session ticket extension" \ |
| 2787 | -s "server hello, adding session ticket extension" \ |
| 2788 | -c "found session_ticket extension" \ |
| 2789 | -c "parse new session ticket" \ |
| 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 | |
| 2795 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 2796 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 2797 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2798 | 0 \ |
| 2799 | -c "client hello, adding session ticket extension" \ |
| 2800 | -s "found session ticket extension" \ |
| 2801 | -s "server hello, adding session ticket extension" \ |
| 2802 | -c "found session_ticket extension" \ |
| 2803 | -c "parse new session ticket" \ |
| 2804 | -S "session successfully restored from cache" \ |
| 2805 | -s "session successfully restored from ticket" \ |
| 2806 | -s "a session has been resumed" \ |
| 2807 | -c "a session has been resumed" |
| 2808 | |
| 2809 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 2810 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 2811 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2812 | 0 \ |
| 2813 | -c "client hello, adding session ticket extension" \ |
| 2814 | -s "found session ticket extension" \ |
| 2815 | -s "server hello, adding session ticket extension" \ |
| 2816 | -c "found session_ticket extension" \ |
| 2817 | -c "parse new session ticket" \ |
| 2818 | -S "session successfully restored from cache" \ |
| 2819 | -s "session successfully restored from ticket" \ |
| 2820 | -s "a session has been resumed" \ |
| 2821 | -c "a session has been resumed" |
| 2822 | |
| 2823 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 2824 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 2825 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2826 | 0 \ |
| 2827 | -c "client hello, adding session ticket extension" \ |
| 2828 | -s "found session ticket extension" \ |
| 2829 | -s "server hello, adding session ticket extension" \ |
| 2830 | -c "found session_ticket extension" \ |
| 2831 | -c "parse new session ticket" \ |
| 2832 | -S "session successfully restored from cache" \ |
| 2833 | -s "session successfully restored from ticket" \ |
| 2834 | -s "a session has been resumed" \ |
| 2835 | -c "a session has been resumed" |
| 2836 | |
| 2837 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 2838 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 2839 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2840 | 0 \ |
| 2841 | -c "client hello, adding session ticket extension" \ |
| 2842 | -s "found session ticket extension" \ |
| 2843 | -s "server hello, adding session ticket extension" \ |
| 2844 | -c "found session_ticket extension" \ |
| 2845 | -c "parse new session ticket" \ |
| 2846 | -S "session successfully restored from cache" \ |
| 2847 | -s "session successfully restored from ticket" \ |
| 2848 | -s "a session has been resumed" \ |
| 2849 | -c "a session has been resumed" |
| 2850 | |
| 2851 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 2852 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 2853 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2854 | 0 \ |
| 2855 | -c "client hello, adding session ticket extension" \ |
| 2856 | -s "found session ticket extension" \ |
| 2857 | -s "server hello, adding session ticket extension" \ |
| 2858 | -c "found session_ticket extension" \ |
| 2859 | -c "parse new session ticket" \ |
| 2860 | -S "session successfully restored from cache" \ |
| 2861 | -s "session successfully restored from ticket" \ |
| 2862 | -s "a session has been resumed" \ |
| 2863 | -c "a session has been resumed" |
| 2864 | |
| 2865 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 2866 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 2867 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2868 | 0 \ |
| 2869 | -c "client hello, adding session ticket extension" \ |
| 2870 | -s "found session ticket extension" \ |
| 2871 | -s "server hello, adding session ticket extension" \ |
| 2872 | -c "found session_ticket extension" \ |
| 2873 | -c "parse new session ticket" \ |
| 2874 | -S "session successfully restored from cache" \ |
| 2875 | -s "session successfully restored from ticket" \ |
| 2876 | -s "a session has been resumed" \ |
| 2877 | -c "a session has been resumed" |
| 2878 | |
| 2879 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 2880 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 2881 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2882 | 0 \ |
| 2883 | -c "client hello, adding session ticket extension" \ |
| 2884 | -s "found session ticket extension" \ |
| 2885 | -s "server hello, adding session ticket extension" \ |
| 2886 | -c "found session_ticket extension" \ |
| 2887 | -c "parse new session ticket" \ |
| 2888 | -S "session successfully restored from cache" \ |
| 2889 | -s "session successfully restored from ticket" \ |
| 2890 | -s "a session has been resumed" \ |
| 2891 | -c "a session has been resumed" |
| 2892 | |
| 2893 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 2894 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 2895 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2896 | 0 \ |
| 2897 | -c "client hello, adding session ticket extension" \ |
| 2898 | -s "found session ticket extension" \ |
| 2899 | -s "server hello, adding session ticket extension" \ |
| 2900 | -c "found session_ticket extension" \ |
| 2901 | -c "parse new session ticket" \ |
| 2902 | -S "session successfully restored from cache" \ |
| 2903 | -s "session successfully restored from ticket" \ |
| 2904 | -s "a session has been resumed" \ |
| 2905 | -c "a session has been resumed" |
| 2906 | |
| 2907 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 2908 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 2909 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2910 | 0 \ |
| 2911 | -c "client hello, adding session ticket extension" \ |
| 2912 | -s "found session ticket extension" \ |
| 2913 | -s "server hello, adding session ticket extension" \ |
| 2914 | -c "found session_ticket extension" \ |
| 2915 | -c "parse new session ticket" \ |
| 2916 | -S "session successfully restored from cache" \ |
| 2917 | -s "session successfully restored from ticket" \ |
| 2918 | -s "a session has been resumed" \ |
| 2919 | -c "a session has been resumed" |
| 2920 | |
| 2921 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 2922 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 2923 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2924 | 0 \ |
| 2925 | -c "client hello, adding session ticket extension" \ |
| 2926 | -s "found session ticket extension" \ |
| 2927 | -s "server hello, adding session ticket extension" \ |
| 2928 | -c "found session_ticket extension" \ |
| 2929 | -c "parse new session ticket" \ |
| 2930 | -S "session successfully restored from cache" \ |
| 2931 | -s "session successfully restored from ticket" \ |
| 2932 | -s "a session has been resumed" \ |
| 2933 | -c "a session has been resumed" |
| 2934 | |
| 2935 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 2936 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 2937 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2938 | 0 \ |
| 2939 | -c "client hello, adding session ticket extension" \ |
| 2940 | -s "found session ticket extension" \ |
| 2941 | -s "server hello, adding session ticket extension" \ |
| 2942 | -c "found session_ticket extension" \ |
| 2943 | -c "parse new session ticket" \ |
| 2944 | -S "session successfully restored from cache" \ |
| 2945 | -s "session successfully restored from ticket" \ |
| 2946 | -s "a session has been resumed" \ |
| 2947 | -c "a session has been resumed" |
| 2948 | |
| 2949 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 2950 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 2951 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2952 | 0 \ |
| 2953 | -c "client hello, adding session ticket extension" \ |
| 2954 | -s "found session ticket extension" \ |
| 2955 | -s "server hello, adding session ticket extension" \ |
| 2956 | -c "found session_ticket extension" \ |
| 2957 | -c "parse new session ticket" \ |
| 2958 | -S "session successfully restored from cache" \ |
| 2959 | -s "session successfully restored from ticket" \ |
| 2960 | -s "a session has been resumed" \ |
| 2961 | -c "a session has been resumed" |
| 2962 | |
| 2963 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 2964 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 2965 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 2966 | 0 \ |
| 2967 | -c "client hello, adding session ticket extension" \ |
| 2968 | -s "found session ticket extension" \ |
| 2969 | -s "server hello, adding session ticket extension" \ |
| 2970 | -c "found session_ticket extension" \ |
| 2971 | -c "parse new session ticket" \ |
| 2972 | -S "session successfully restored from cache" \ |
| 2973 | -s "session successfully restored from ticket" \ |
| 2974 | -s "a session has been resumed" \ |
| 2975 | -c "a session has been resumed" |
| 2976 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2977 | # Tests for Session Tickets with DTLS |
| 2978 | |
| 2979 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2980 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2981 | "$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] | 2982 | 0 \ |
| 2983 | -c "client hello, adding session ticket extension" \ |
| 2984 | -s "found session ticket extension" \ |
| 2985 | -s "server hello, adding session ticket extension" \ |
| 2986 | -c "found session_ticket extension" \ |
| 2987 | -c "parse new session ticket" \ |
| 2988 | -S "session successfully restored from cache" \ |
| 2989 | -s "session successfully restored from ticket" \ |
| 2990 | -s "a session has been resumed" \ |
| 2991 | -c "a session has been resumed" |
| 2992 | |
| 2993 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2994 | "$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] | 2995 | "$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] | 2996 | 0 \ |
| 2997 | -c "client hello, adding session ticket extension" \ |
| 2998 | -s "found session ticket extension" \ |
| 2999 | -s "server hello, adding session ticket extension" \ |
| 3000 | -c "found session_ticket extension" \ |
| 3001 | -c "parse new session ticket" \ |
| 3002 | -S "session successfully restored from cache" \ |
| 3003 | -s "session successfully restored from ticket" \ |
| 3004 | -s "a session has been resumed" \ |
| 3005 | -c "a session has been resumed" |
| 3006 | |
| 3007 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3008 | "$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] | 3009 | "$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] | 3010 | 0 \ |
| 3011 | -c "client hello, adding session ticket extension" \ |
| 3012 | -s "found session ticket extension" \ |
| 3013 | -s "server hello, adding session ticket extension" \ |
| 3014 | -c "found session_ticket extension" \ |
| 3015 | -c "parse new session ticket" \ |
| 3016 | -S "session successfully restored from cache" \ |
| 3017 | -S "session successfully restored from ticket" \ |
| 3018 | -S "a session has been resumed" \ |
| 3019 | -C "a session has been resumed" |
| 3020 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3021 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3022 | "$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] | 3023 | "$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] | 3024 | 0 \ |
| 3025 | -c "client hello, adding session ticket extension" \ |
| 3026 | -s "found session ticket extension" \ |
| 3027 | -s "server hello, adding session ticket extension" \ |
| 3028 | -c "found session_ticket extension" \ |
| 3029 | -c "parse new session ticket" \ |
| 3030 | -S "session successfully restored from cache" \ |
| 3031 | -s "session successfully restored from ticket" \ |
| 3032 | -s "a session has been resumed" \ |
| 3033 | -c "a session has been resumed" |
| 3034 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3035 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3036 | "$O_SRV -dtls" \ |
| 3037 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3038 | 0 \ |
| 3039 | -c "client hello, adding session ticket extension" \ |
| 3040 | -c "found session_ticket extension" \ |
| 3041 | -c "parse new session ticket" \ |
| 3042 | -c "a session has been resumed" |
| 3043 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3044 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 09cfa18 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 3045 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3046 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3047 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3048 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3049 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3050 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3051 | rm -f $SESSION )" \ |
| 3052 | 0 \ |
| 3053 | -s "found session ticket extension" \ |
| 3054 | -s "server hello, adding session ticket extension" \ |
| 3055 | -S "session successfully restored from cache" \ |
| 3056 | -s "session successfully restored from ticket" \ |
| 3057 | -s "a session has been resumed" |
| 3058 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3059 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3060 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3061 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3062 | "$P_SRV debug_level=3 tickets=0" \ |
| 3063 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3064 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3065 | -c "client hello, adding session ticket extension" \ |
| 3066 | -s "found session ticket extension" \ |
| 3067 | -S "server hello, adding session ticket extension" \ |
| 3068 | -C "found session_ticket extension" \ |
| 3069 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3070 | -s "session successfully restored from cache" \ |
| 3071 | -S "session successfully restored from ticket" \ |
| 3072 | -s "a session has been resumed" \ |
| 3073 | -c "a session has been resumed" |
| 3074 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3075 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3076 | "$P_SRV debug_level=3 tickets=1" \ |
| 3077 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3078 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3079 | -C "client hello, adding session ticket extension" \ |
| 3080 | -S "found session ticket extension" \ |
| 3081 | -S "server hello, adding session ticket extension" \ |
| 3082 | -C "found session_ticket extension" \ |
| 3083 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3084 | -s "session successfully restored from cache" \ |
| 3085 | -S "session successfully restored from ticket" \ |
| 3086 | -s "a session has been resumed" \ |
| 3087 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3088 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3089 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3090 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3091 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3092 | 0 \ |
| 3093 | -S "session successfully restored from cache" \ |
| 3094 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3095 | -S "a session has been resumed" \ |
| 3096 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3097 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3098 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3099 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3100 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3101 | 0 \ |
| 3102 | -s "session successfully restored from cache" \ |
| 3103 | -S "session successfully restored from ticket" \ |
| 3104 | -s "a session has been resumed" \ |
| 3105 | -c "a session has been resumed" |
| 3106 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3107 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3108 | "$P_SRV debug_level=3 tickets=0" \ |
| 3109 | "$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] | 3110 | 0 \ |
| 3111 | -s "session successfully restored from cache" \ |
| 3112 | -S "session successfully restored from ticket" \ |
| 3113 | -s "a session has been resumed" \ |
| 3114 | -c "a session has been resumed" |
| 3115 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3116 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3117 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3118 | "$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] | 3119 | 0 \ |
| 3120 | -S "session successfully restored from cache" \ |
| 3121 | -S "session successfully restored from ticket" \ |
| 3122 | -S "a session has been resumed" \ |
| 3123 | -C "a session has been resumed" |
| 3124 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3125 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3126 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3127 | "$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] | 3128 | 0 \ |
| 3129 | -s "session successfully restored from cache" \ |
| 3130 | -S "session successfully restored from ticket" \ |
| 3131 | -s "a session has been resumed" \ |
| 3132 | -c "a session has been resumed" |
| 3133 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3134 | run_test "Session resume using cache: session copy" \ |
| 3135 | "$P_SRV debug_level=3 tickets=0" \ |
| 3136 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3137 | 0 \ |
| 3138 | -s "session successfully restored from cache" \ |
| 3139 | -S "session successfully restored from ticket" \ |
| 3140 | -s "a session has been resumed" \ |
| 3141 | -c "a session has been resumed" |
| 3142 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3143 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3144 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3145 | "( $O_CLI -sess_out $SESSION; \ |
| 3146 | $O_CLI -sess_in $SESSION; \ |
| 3147 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3148 | 0 \ |
| 3149 | -s "found session ticket extension" \ |
| 3150 | -S "server hello, adding session ticket extension" \ |
| 3151 | -s "session successfully restored from cache" \ |
| 3152 | -S "session successfully restored from ticket" \ |
| 3153 | -s "a session has been resumed" |
| 3154 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3155 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3156 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3157 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3158 | 0 \ |
| 3159 | -C "found session_ticket extension" \ |
| 3160 | -C "parse new session ticket" \ |
| 3161 | -c "a session has been resumed" |
| 3162 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3163 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3164 | |
| 3165 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3166 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3167 | "$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] | 3168 | 0 \ |
| 3169 | -c "client hello, adding session ticket extension" \ |
| 3170 | -s "found session ticket extension" \ |
| 3171 | -S "server hello, adding session ticket extension" \ |
| 3172 | -C "found session_ticket extension" \ |
| 3173 | -C "parse new session ticket" \ |
| 3174 | -s "session successfully restored from cache" \ |
| 3175 | -S "session successfully restored from ticket" \ |
| 3176 | -s "a session has been resumed" \ |
| 3177 | -c "a session has been resumed" |
| 3178 | |
| 3179 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3180 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3181 | "$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] | 3182 | 0 \ |
| 3183 | -C "client hello, adding session ticket extension" \ |
| 3184 | -S "found session ticket extension" \ |
| 3185 | -S "server hello, adding session ticket extension" \ |
| 3186 | -C "found session_ticket extension" \ |
| 3187 | -C "parse new session ticket" \ |
| 3188 | -s "session successfully restored from cache" \ |
| 3189 | -S "session successfully restored from ticket" \ |
| 3190 | -s "a session has been resumed" \ |
| 3191 | -c "a session has been resumed" |
| 3192 | |
| 3193 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3194 | "$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] | 3195 | "$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] | 3196 | 0 \ |
| 3197 | -S "session successfully restored from cache" \ |
| 3198 | -S "session successfully restored from ticket" \ |
| 3199 | -S "a session has been resumed" \ |
| 3200 | -C "a session has been resumed" |
| 3201 | |
| 3202 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3203 | "$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] | 3204 | "$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] | 3205 | 0 \ |
| 3206 | -s "session successfully restored from cache" \ |
| 3207 | -S "session successfully restored from ticket" \ |
| 3208 | -s "a session has been resumed" \ |
| 3209 | -c "a session has been resumed" |
| 3210 | |
| 3211 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3212 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3213 | "$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] | 3214 | 0 \ |
| 3215 | -s "session successfully restored from cache" \ |
| 3216 | -S "session successfully restored from ticket" \ |
| 3217 | -s "a session has been resumed" \ |
| 3218 | -c "a session has been resumed" |
| 3219 | |
| 3220 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3221 | "$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] | 3222 | "$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] | 3223 | 0 \ |
| 3224 | -S "session successfully restored from cache" \ |
| 3225 | -S "session successfully restored from ticket" \ |
| 3226 | -S "a session has been resumed" \ |
| 3227 | -C "a session has been resumed" |
| 3228 | |
| 3229 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3230 | "$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] | 3231 | "$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] | 3232 | 0 \ |
| 3233 | -s "session successfully restored from cache" \ |
| 3234 | -S "session successfully restored from ticket" \ |
| 3235 | -s "a session has been resumed" \ |
| 3236 | -c "a session has been resumed" |
| 3237 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3238 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3239 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3240 | "$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] | 3241 | 0 \ |
| 3242 | -s "session successfully restored from cache" \ |
| 3243 | -S "session successfully restored from ticket" \ |
| 3244 | -s "a session has been resumed" \ |
| 3245 | -c "a session has been resumed" |
| 3246 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3247 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 09cfa18 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 3248 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3249 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3250 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3251 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3252 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3253 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3254 | rm -f $SESSION )" \ |
| 3255 | 0 \ |
| 3256 | -s "found session ticket extension" \ |
| 3257 | -S "server hello, adding session ticket extension" \ |
| 3258 | -s "session successfully restored from cache" \ |
| 3259 | -S "session successfully restored from ticket" \ |
| 3260 | -s "a session has been resumed" |
| 3261 | |
| 3262 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3263 | "$O_SRV -dtls" \ |
| 3264 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3265 | 0 \ |
| 3266 | -C "found session_ticket extension" \ |
| 3267 | -C "parse new session ticket" \ |
| 3268 | -c "a session has been resumed" |
| 3269 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3270 | # Tests for Max Fragment Length extension |
| 3271 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3272 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3273 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3274 | "$P_SRV debug_level=3" \ |
| 3275 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3276 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3277 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3278 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3279 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3280 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3281 | -C "client hello, adding max_fragment_length extension" \ |
| 3282 | -S "found max fragment length extension" \ |
| 3283 | -S "server hello, max_fragment_length extension" \ |
| 3284 | -C "found max_fragment_length extension" |
| 3285 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3286 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3287 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3288 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3289 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3290 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3291 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3292 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3293 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3294 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3295 | -C "client hello, adding max_fragment_length extension" \ |
| 3296 | -S "found max fragment length extension" \ |
| 3297 | -S "server hello, max_fragment_length extension" \ |
| 3298 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3299 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3300 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3301 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3302 | |
| 3303 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3304 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3305 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3306 | "$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] | 3307 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3308 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3309 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3310 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3311 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3312 | -C "client hello, adding max_fragment_length extension" \ |
| 3313 | -S "found max fragment length extension" \ |
| 3314 | -S "server hello, max_fragment_length extension" \ |
| 3315 | -C "found max_fragment_length extension" \ |
| 3316 | -c "fragment larger than.*maximum " |
| 3317 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3318 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3319 | # (session fragment length will be 16384 regardless of mbedtls |
| 3320 | # content length configuration.) |
| 3321 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3322 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3323 | run_test "Max fragment length: disabled, larger message" \ |
| 3324 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3325 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3326 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3327 | -C "Maximum incoming record payload length is 16384" \ |
| 3328 | -C "Maximum outgoing record payload length is 16384" \ |
| 3329 | -S "Maximum incoming record payload length is 16384" \ |
| 3330 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3331 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3332 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3333 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3334 | |
| 3335 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3336 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3337 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3338 | "$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] | 3339 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3340 | -C "Maximum incoming record payload length is 16384" \ |
| 3341 | -C "Maximum outgoing record payload length is 16384" \ |
| 3342 | -S "Maximum incoming record payload length is 16384" \ |
| 3343 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3344 | -c "fragment larger than.*maximum " |
| 3345 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3346 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3347 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3348 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3349 | "$P_SRV debug_level=3" \ |
| 3350 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3351 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3352 | -c "Maximum incoming record payload length is 4096" \ |
| 3353 | -c "Maximum outgoing record payload length is 4096" \ |
| 3354 | -s "Maximum incoming record payload length is 4096" \ |
| 3355 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3356 | -c "client hello, adding max_fragment_length extension" \ |
| 3357 | -s "found max fragment length extension" \ |
| 3358 | -s "server hello, max_fragment_length extension" \ |
| 3359 | -c "found max_fragment_length extension" |
| 3360 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3361 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3362 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3363 | run_test "Max fragment length: client 512, server 1024" \ |
| 3364 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3365 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3366 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3367 | -c "Maximum incoming record payload length is 512" \ |
| 3368 | -c "Maximum outgoing record payload length is 512" \ |
| 3369 | -s "Maximum incoming record payload length is 512" \ |
| 3370 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3371 | -c "client hello, adding max_fragment_length extension" \ |
| 3372 | -s "found max fragment length extension" \ |
| 3373 | -s "server hello, max_fragment_length extension" \ |
| 3374 | -c "found max_fragment_length extension" |
| 3375 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3376 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3377 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3378 | run_test "Max fragment length: client 512, server 2048" \ |
| 3379 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3380 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3381 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3382 | -c "Maximum incoming record payload length is 512" \ |
| 3383 | -c "Maximum outgoing record payload length is 512" \ |
| 3384 | -s "Maximum incoming record payload length is 512" \ |
| 3385 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3386 | -c "client hello, adding max_fragment_length extension" \ |
| 3387 | -s "found max fragment length extension" \ |
| 3388 | -s "server hello, max_fragment_length extension" \ |
| 3389 | -c "found max_fragment_length extension" |
| 3390 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3391 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3392 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3393 | run_test "Max fragment length: client 512, server 4096" \ |
| 3394 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3395 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3396 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3397 | -c "Maximum incoming record payload length is 512" \ |
| 3398 | -c "Maximum outgoing record payload length is 512" \ |
| 3399 | -s "Maximum incoming record payload length is 512" \ |
| 3400 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3401 | -c "client hello, adding max_fragment_length extension" \ |
| 3402 | -s "found max fragment length extension" \ |
| 3403 | -s "server hello, max_fragment_length extension" \ |
| 3404 | -c "found max_fragment_length extension" |
| 3405 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3406 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3407 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3408 | run_test "Max fragment length: client 1024, server 512" \ |
| 3409 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3410 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3411 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3412 | -c "Maximum incoming record payload length is 1024" \ |
| 3413 | -c "Maximum outgoing record payload length is 1024" \ |
| 3414 | -s "Maximum incoming record payload length is 1024" \ |
| 3415 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3416 | -c "client hello, adding max_fragment_length extension" \ |
| 3417 | -s "found max fragment length extension" \ |
| 3418 | -s "server hello, max_fragment_length extension" \ |
| 3419 | -c "found max_fragment_length extension" |
| 3420 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3421 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3422 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3423 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3424 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3425 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3426 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3427 | -c "Maximum incoming record payload length is 1024" \ |
| 3428 | -c "Maximum outgoing record payload length is 1024" \ |
| 3429 | -s "Maximum incoming record payload length is 1024" \ |
| 3430 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3431 | -c "client hello, adding max_fragment_length extension" \ |
| 3432 | -s "found max fragment length extension" \ |
| 3433 | -s "server hello, max_fragment_length extension" \ |
| 3434 | -c "found max_fragment_length extension" |
| 3435 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3436 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3437 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3438 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3439 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3440 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3441 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3442 | -c "Maximum incoming record payload length is 1024" \ |
| 3443 | -c "Maximum outgoing record payload length is 1024" \ |
| 3444 | -s "Maximum incoming record payload length is 1024" \ |
| 3445 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3446 | -c "client hello, adding max_fragment_length extension" \ |
| 3447 | -s "found max fragment length extension" \ |
| 3448 | -s "server hello, max_fragment_length extension" \ |
| 3449 | -c "found max_fragment_length extension" |
| 3450 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3451 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3452 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3453 | run_test "Max fragment length: client 2048, server 512" \ |
| 3454 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3455 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3456 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3457 | -c "Maximum incoming record payload length is 2048" \ |
| 3458 | -c "Maximum outgoing record payload length is 2048" \ |
| 3459 | -s "Maximum incoming record payload length is 2048" \ |
| 3460 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3461 | -c "client hello, adding max_fragment_length extension" \ |
| 3462 | -s "found max fragment length extension" \ |
| 3463 | -s "server hello, max_fragment_length extension" \ |
| 3464 | -c "found max_fragment_length extension" |
| 3465 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3466 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3467 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3468 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3469 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3470 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3471 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3472 | -c "Maximum incoming record payload length is 2048" \ |
| 3473 | -c "Maximum outgoing record payload length is 2048" \ |
| 3474 | -s "Maximum incoming record payload length is 2048" \ |
| 3475 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3476 | -c "client hello, adding max_fragment_length extension" \ |
| 3477 | -s "found max fragment length extension" \ |
| 3478 | -s "server hello, max_fragment_length extension" \ |
| 3479 | -c "found max_fragment_length extension" |
| 3480 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3481 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3482 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3483 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3484 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3485 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3486 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3487 | -c "Maximum incoming record payload length is 2048" \ |
| 3488 | -c "Maximum outgoing record payload length is 2048" \ |
| 3489 | -s "Maximum incoming record payload length is 2048" \ |
| 3490 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3491 | -c "client hello, adding max_fragment_length extension" \ |
| 3492 | -s "found max fragment length extension" \ |
| 3493 | -s "server hello, max_fragment_length extension" \ |
| 3494 | -c "found max_fragment_length extension" |
| 3495 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3496 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3497 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3498 | run_test "Max fragment length: client 4096, server 512" \ |
| 3499 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3500 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3501 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3502 | -c "Maximum incoming record payload length is 4096" \ |
| 3503 | -c "Maximum outgoing record payload length is 4096" \ |
| 3504 | -s "Maximum incoming record payload length is 4096" \ |
| 3505 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3506 | -c "client hello, adding max_fragment_length extension" \ |
| 3507 | -s "found max fragment length extension" \ |
| 3508 | -s "server hello, max_fragment_length extension" \ |
| 3509 | -c "found max_fragment_length extension" |
| 3510 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3511 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3512 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3513 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3514 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3515 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3516 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3517 | -c "Maximum incoming record payload length is 4096" \ |
| 3518 | -c "Maximum outgoing record payload length is 4096" \ |
| 3519 | -s "Maximum incoming record payload length is 4096" \ |
| 3520 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3521 | -c "client hello, adding max_fragment_length extension" \ |
| 3522 | -s "found max fragment length extension" \ |
| 3523 | -s "server hello, max_fragment_length extension" \ |
| 3524 | -c "found max_fragment_length extension" |
| 3525 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3526 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3527 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3528 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3529 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3530 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3531 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3532 | -c "Maximum incoming record payload length is 4096" \ |
| 3533 | -c "Maximum outgoing record payload length is 4096" \ |
| 3534 | -s "Maximum incoming record payload length is 4096" \ |
| 3535 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3536 | -c "client hello, adding max_fragment_length extension" \ |
| 3537 | -s "found max fragment length extension" \ |
| 3538 | -s "server hello, max_fragment_length extension" \ |
| 3539 | -c "found max_fragment_length extension" |
| 3540 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3541 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3542 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3543 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3544 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3545 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3546 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3547 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3548 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3549 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3550 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3551 | -C "client hello, adding max_fragment_length extension" \ |
| 3552 | -S "found max fragment length extension" \ |
| 3553 | -S "server hello, max_fragment_length extension" \ |
| 3554 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3555 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3556 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3557 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3558 | requires_gnutls |
| 3559 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3560 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3561 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3562 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3563 | -c "Maximum incoming record payload length is 4096" \ |
| 3564 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3565 | -c "client hello, adding max_fragment_length extension" \ |
| 3566 | -c "found max_fragment_length extension" |
| 3567 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3568 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3569 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3570 | run_test "Max fragment length: client, message just fits" \ |
| 3571 | "$P_SRV debug_level=3" \ |
| 3572 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3573 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3574 | -c "Maximum incoming record payload length is 2048" \ |
| 3575 | -c "Maximum outgoing record payload length is 2048" \ |
| 3576 | -s "Maximum incoming record payload length is 2048" \ |
| 3577 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3578 | -c "client hello, adding max_fragment_length extension" \ |
| 3579 | -s "found max fragment length extension" \ |
| 3580 | -s "server hello, max_fragment_length extension" \ |
| 3581 | -c "found max_fragment_length extension" \ |
| 3582 | -c "2048 bytes written in 1 fragments" \ |
| 3583 | -s "2048 bytes read" |
| 3584 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3585 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3586 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3587 | run_test "Max fragment length: client, larger message" \ |
| 3588 | "$P_SRV debug_level=3" \ |
| 3589 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3590 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3591 | -c "Maximum incoming record payload length is 2048" \ |
| 3592 | -c "Maximum outgoing record payload length is 2048" \ |
| 3593 | -s "Maximum incoming record payload length is 2048" \ |
| 3594 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3595 | -c "client hello, adding max_fragment_length extension" \ |
| 3596 | -s "found max fragment length extension" \ |
| 3597 | -s "server hello, max_fragment_length extension" \ |
| 3598 | -c "found max_fragment_length extension" \ |
| 3599 | -c "2345 bytes written in 2 fragments" \ |
| 3600 | -s "2048 bytes read" \ |
| 3601 | -s "297 bytes read" |
| 3602 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3603 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3604 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3605 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3606 | "$P_SRV debug_level=3 dtls=1" \ |
| 3607 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3608 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3609 | -c "Maximum incoming record payload length is 2048" \ |
| 3610 | -c "Maximum outgoing record payload length is 2048" \ |
| 3611 | -s "Maximum incoming record payload length is 2048" \ |
| 3612 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3613 | -c "client hello, adding max_fragment_length extension" \ |
| 3614 | -s "found max fragment length extension" \ |
| 3615 | -s "server hello, max_fragment_length extension" \ |
| 3616 | -c "found max_fragment_length extension" \ |
| 3617 | -c "fragment larger than.*maximum" |
| 3618 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3619 | # Tests for renegotiation |
| 3620 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3621 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3622 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3623 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3624 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3625 | 0 \ |
| 3626 | -C "client hello, adding renegotiation extension" \ |
| 3627 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3628 | -S "found renegotiation extension" \ |
| 3629 | -s "server hello, secure renegotiation extension" \ |
| 3630 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3631 | -C "=> renegotiate" \ |
| 3632 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3633 | -S "write hello request" |
| 3634 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3635 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3636 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3637 | "$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] | 3638 | "$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] | 3639 | 0 \ |
| 3640 | -c "client hello, adding renegotiation extension" \ |
| 3641 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3642 | -s "found renegotiation extension" \ |
| 3643 | -s "server hello, secure renegotiation extension" \ |
| 3644 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3645 | -c "=> renegotiate" \ |
| 3646 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3647 | -S "write hello request" |
| 3648 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3649 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3650 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3651 | "$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] | 3652 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3653 | 0 \ |
| 3654 | -c "client hello, adding renegotiation extension" \ |
| 3655 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3656 | -s "found renegotiation extension" \ |
| 3657 | -s "server hello, secure renegotiation extension" \ |
| 3658 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3659 | -c "=> renegotiate" \ |
| 3660 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3661 | -s "write hello request" |
| 3662 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3663 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3664 | # 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] | 3665 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3666 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3667 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3668 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3669 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3670 | 0 \ |
| 3671 | -c "client hello, adding renegotiation extension" \ |
| 3672 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3673 | -s "found renegotiation extension" \ |
| 3674 | -s "server hello, secure renegotiation extension" \ |
| 3675 | -c "found renegotiation extension" \ |
| 3676 | -c "=> renegotiate" \ |
| 3677 | -s "=> renegotiate" \ |
| 3678 | -S "write hello request" \ |
| 3679 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3680 | |
| 3681 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3682 | # 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] | 3683 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3684 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3685 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3686 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3687 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3688 | 0 \ |
| 3689 | -c "client hello, adding renegotiation extension" \ |
| 3690 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3691 | -s "found renegotiation extension" \ |
| 3692 | -s "server hello, secure renegotiation extension" \ |
| 3693 | -c "found renegotiation extension" \ |
| 3694 | -c "=> renegotiate" \ |
| 3695 | -s "=> renegotiate" \ |
| 3696 | -s "write hello request" \ |
| 3697 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3698 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3699 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3700 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3701 | "$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] | 3702 | "$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] | 3703 | 0 \ |
| 3704 | -c "client hello, adding renegotiation extension" \ |
| 3705 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3706 | -s "found renegotiation extension" \ |
| 3707 | -s "server hello, secure renegotiation extension" \ |
| 3708 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3709 | -c "=> renegotiate" \ |
| 3710 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3711 | -s "write hello request" |
| 3712 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3713 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3714 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3715 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3716 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3717 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3718 | "$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" \ |
| 3719 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3720 | -c "Maximum incoming record payload length is 2048" \ |
| 3721 | -c "Maximum outgoing record payload length is 2048" \ |
| 3722 | -s "Maximum incoming record payload length is 2048" \ |
| 3723 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3724 | -c "client hello, adding max_fragment_length extension" \ |
| 3725 | -s "found max fragment length extension" \ |
| 3726 | -s "server hello, max_fragment_length extension" \ |
| 3727 | -c "found max_fragment_length extension" \ |
| 3728 | -c "client hello, adding renegotiation extension" \ |
| 3729 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3730 | -s "found renegotiation extension" \ |
| 3731 | -s "server hello, secure renegotiation extension" \ |
| 3732 | -c "found renegotiation extension" \ |
| 3733 | -c "=> renegotiate" \ |
| 3734 | -s "=> renegotiate" \ |
| 3735 | -s "write hello request" |
| 3736 | |
| 3737 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3738 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3739 | "$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] | 3740 | "$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] | 3741 | 1 \ |
| 3742 | -c "client hello, adding renegotiation extension" \ |
| 3743 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3744 | -S "found renegotiation extension" \ |
| 3745 | -s "server hello, secure renegotiation extension" \ |
| 3746 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3747 | -c "=> renegotiate" \ |
| 3748 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3749 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3750 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3751 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3752 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3753 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3754 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3755 | "$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] | 3756 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3757 | 0 \ |
| 3758 | -C "client hello, adding renegotiation extension" \ |
| 3759 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3760 | -S "found renegotiation extension" \ |
| 3761 | -s "server hello, secure renegotiation extension" \ |
| 3762 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3763 | -C "=> renegotiate" \ |
| 3764 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3765 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3766 | -S "SSL - An unexpected message was received from our peer" \ |
| 3767 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3768 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3770 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3771 | "$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] | 3772 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3773 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3774 | 0 \ |
| 3775 | -C "client hello, adding renegotiation extension" \ |
| 3776 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3777 | -S "found renegotiation extension" \ |
| 3778 | -s "server hello, secure renegotiation extension" \ |
| 3779 | -c "found renegotiation extension" \ |
| 3780 | -C "=> renegotiate" \ |
| 3781 | -S "=> renegotiate" \ |
| 3782 | -s "write hello request" \ |
| 3783 | -S "SSL - An unexpected message was received from our peer" \ |
| 3784 | -S "failed" |
| 3785 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3786 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3787 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3788 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3789 | "$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] | 3790 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3791 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3792 | 0 \ |
| 3793 | -C "client hello, adding renegotiation extension" \ |
| 3794 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3795 | -S "found renegotiation extension" \ |
| 3796 | -s "server hello, secure renegotiation extension" \ |
| 3797 | -c "found renegotiation extension" \ |
| 3798 | -C "=> renegotiate" \ |
| 3799 | -S "=> renegotiate" \ |
| 3800 | -s "write hello request" \ |
| 3801 | -S "SSL - An unexpected message was received from our peer" \ |
| 3802 | -S "failed" |
| 3803 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3804 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3805 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3806 | "$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] | 3807 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3808 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3809 | 0 \ |
| 3810 | -C "client hello, adding renegotiation extension" \ |
| 3811 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3812 | -S "found renegotiation extension" \ |
| 3813 | -s "server hello, secure renegotiation extension" \ |
| 3814 | -c "found renegotiation extension" \ |
| 3815 | -C "=> renegotiate" \ |
| 3816 | -S "=> renegotiate" \ |
| 3817 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3818 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3819 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3820 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3821 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3822 | "$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] | 3823 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3824 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3825 | 0 \ |
| 3826 | -c "client hello, adding renegotiation extension" \ |
| 3827 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3828 | -s "found renegotiation extension" \ |
| 3829 | -s "server hello, secure renegotiation extension" \ |
| 3830 | -c "found renegotiation extension" \ |
| 3831 | -c "=> renegotiate" \ |
| 3832 | -s "=> renegotiate" \ |
| 3833 | -s "write hello request" \ |
| 3834 | -S "SSL - An unexpected message was received from our peer" \ |
| 3835 | -S "failed" |
| 3836 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3837 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3838 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3839 | "$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] | 3840 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3841 | 0 \ |
| 3842 | -C "client hello, adding renegotiation extension" \ |
| 3843 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3844 | -S "found renegotiation extension" \ |
| 3845 | -s "server hello, secure renegotiation extension" \ |
| 3846 | -c "found renegotiation extension" \ |
| 3847 | -S "record counter limit reached: renegotiate" \ |
| 3848 | -C "=> renegotiate" \ |
| 3849 | -S "=> renegotiate" \ |
| 3850 | -S "write hello request" \ |
| 3851 | -S "SSL - An unexpected message was received from our peer" \ |
| 3852 | -S "failed" |
| 3853 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3854 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3855 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3856 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3857 | "$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] | 3858 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3859 | 0 \ |
| 3860 | -c "client hello, adding renegotiation extension" \ |
| 3861 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3862 | -s "found renegotiation extension" \ |
| 3863 | -s "server hello, secure renegotiation extension" \ |
| 3864 | -c "found renegotiation extension" \ |
| 3865 | -s "record counter limit reached: renegotiate" \ |
| 3866 | -c "=> renegotiate" \ |
| 3867 | -s "=> renegotiate" \ |
| 3868 | -s "write hello request" \ |
| 3869 | -S "SSL - An unexpected message was received from our peer" \ |
| 3870 | -S "failed" |
| 3871 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3872 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3873 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3874 | "$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] | 3875 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3876 | 0 \ |
| 3877 | -c "client hello, adding renegotiation extension" \ |
| 3878 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3879 | -s "found renegotiation extension" \ |
| 3880 | -s "server hello, secure renegotiation extension" \ |
| 3881 | -c "found renegotiation extension" \ |
| 3882 | -s "record counter limit reached: renegotiate" \ |
| 3883 | -c "=> renegotiate" \ |
| 3884 | -s "=> renegotiate" \ |
| 3885 | -s "write hello request" \ |
| 3886 | -S "SSL - An unexpected message was received from our peer" \ |
| 3887 | -S "failed" |
| 3888 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3889 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3890 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3891 | "$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] | 3892 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3893 | 0 \ |
| 3894 | -C "client hello, adding renegotiation extension" \ |
| 3895 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3896 | -S "found renegotiation extension" \ |
| 3897 | -s "server hello, secure renegotiation extension" \ |
| 3898 | -c "found renegotiation extension" \ |
| 3899 | -S "record counter limit reached: renegotiate" \ |
| 3900 | -C "=> renegotiate" \ |
| 3901 | -S "=> renegotiate" \ |
| 3902 | -S "write hello request" \ |
| 3903 | -S "SSL - An unexpected message was received from our peer" \ |
| 3904 | -S "failed" |
| 3905 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3906 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3907 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3908 | "$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] | 3909 | "$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] | 3910 | 0 \ |
| 3911 | -c "client hello, adding renegotiation extension" \ |
| 3912 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3913 | -s "found renegotiation extension" \ |
| 3914 | -s "server hello, secure renegotiation extension" \ |
| 3915 | -c "found renegotiation extension" \ |
| 3916 | -c "=> renegotiate" \ |
| 3917 | -s "=> renegotiate" \ |
| 3918 | -S "write hello request" |
| 3919 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3920 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3921 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3922 | "$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] | 3923 | "$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] | 3924 | 0 \ |
| 3925 | -c "client hello, adding renegotiation extension" \ |
| 3926 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3927 | -s "found renegotiation extension" \ |
| 3928 | -s "server hello, secure renegotiation extension" \ |
| 3929 | -c "found renegotiation extension" \ |
| 3930 | -c "=> renegotiate" \ |
| 3931 | -s "=> renegotiate" \ |
| 3932 | -s "write hello request" |
| 3933 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3934 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3935 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3936 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3937 | "$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] | 3938 | 0 \ |
| 3939 | -c "client hello, adding renegotiation extension" \ |
| 3940 | -c "found renegotiation extension" \ |
| 3941 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3942 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3943 | -C "error" \ |
| 3944 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3945 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3946 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3947 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3948 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3949 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3950 | "$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] | 3951 | 0 \ |
| 3952 | -c "client hello, adding renegotiation extension" \ |
| 3953 | -c "found renegotiation extension" \ |
| 3954 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3955 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3956 | -C "error" \ |
| 3957 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3958 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3959 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3960 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3961 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3962 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3963 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3964 | 1 \ |
| 3965 | -c "client hello, adding renegotiation extension" \ |
| 3966 | -C "found renegotiation extension" \ |
| 3967 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3968 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3969 | -c "error" \ |
| 3970 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3971 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3972 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3973 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3974 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3975 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3976 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3977 | allow_legacy=0" \ |
| 3978 | 1 \ |
| 3979 | -c "client hello, adding renegotiation extension" \ |
| 3980 | -C "found renegotiation extension" \ |
| 3981 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3982 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3983 | -c "error" \ |
| 3984 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3985 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3986 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3987 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3988 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3989 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3990 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3991 | allow_legacy=1" \ |
| 3992 | 0 \ |
| 3993 | -c "client hello, adding renegotiation extension" \ |
| 3994 | -C "found renegotiation extension" \ |
| 3995 | -c "=> renegotiate" \ |
| 3996 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3997 | -C "error" \ |
| 3998 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3999 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4000 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4001 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4002 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4003 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4004 | 0 \ |
| 4005 | -c "client hello, adding renegotiation extension" \ |
| 4006 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4007 | -s "found renegotiation extension" \ |
| 4008 | -s "server hello, secure renegotiation extension" \ |
| 4009 | -c "found renegotiation extension" \ |
| 4010 | -c "=> renegotiate" \ |
| 4011 | -s "=> renegotiate" \ |
| 4012 | -S "write hello request" |
| 4013 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4014 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4015 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4016 | "$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] | 4017 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4018 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4019 | 0 \ |
| 4020 | -c "client hello, adding renegotiation extension" \ |
| 4021 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4022 | -s "found renegotiation extension" \ |
| 4023 | -s "server hello, secure renegotiation extension" \ |
| 4024 | -c "found renegotiation extension" \ |
| 4025 | -c "=> renegotiate" \ |
| 4026 | -s "=> renegotiate" \ |
| 4027 | -s "write hello request" |
| 4028 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4029 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4030 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4031 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4032 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4033 | 0 \ |
| 4034 | -c "client hello, adding renegotiation extension" \ |
| 4035 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4036 | -s "found renegotiation extension" \ |
| 4037 | -s "server hello, secure renegotiation extension" \ |
| 4038 | -s "record counter limit reached: renegotiate" \ |
| 4039 | -c "=> renegotiate" \ |
| 4040 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4041 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4042 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4043 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4044 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4045 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4046 | "$G_SRV -u --mtu 4096" \ |
| 4047 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4048 | 0 \ |
| 4049 | -c "client hello, adding renegotiation extension" \ |
| 4050 | -c "found renegotiation extension" \ |
| 4051 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4052 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4053 | -C "error" \ |
| 4054 | -s "Extra-header:" |
| 4055 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4056 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 4057 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4058 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4059 | run_test "Renego ext: gnutls server strict, client default" \ |
| 4060 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 4061 | "$P_CLI debug_level=3" \ |
| 4062 | 0 \ |
| 4063 | -c "found renegotiation extension" \ |
| 4064 | -C "error" \ |
| 4065 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4066 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4067 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4068 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 4069 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4070 | "$P_CLI debug_level=3" \ |
| 4071 | 0 \ |
| 4072 | -C "found renegotiation extension" \ |
| 4073 | -C "error" \ |
| 4074 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4075 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4076 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4077 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 4078 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4079 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4080 | 1 \ |
| 4081 | -C "found renegotiation extension" \ |
| 4082 | -c "error" \ |
| 4083 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4084 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4085 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4086 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4087 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4088 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4089 | 0 \ |
| 4090 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4091 | -s "server hello, secure renegotiation extension" |
| 4092 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4093 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4094 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4095 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4096 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4097 | 0 \ |
| 4098 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4099 | -S "server hello, secure renegotiation extension" |
| 4100 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4101 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4102 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4103 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4104 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4105 | 1 \ |
| 4106 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4107 | -S "server hello, secure renegotiation extension" |
| 4108 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4109 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4110 | |
| 4111 | requires_gnutls |
| 4112 | run_test "DER format: no trailing bytes" \ |
| 4113 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4114 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4115 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4116 | 0 \ |
| 4117 | -c "Handshake was completed" \ |
| 4118 | |
| 4119 | requires_gnutls |
| 4120 | run_test "DER format: with a trailing zero byte" \ |
| 4121 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4122 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4123 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4124 | 0 \ |
| 4125 | -c "Handshake was completed" \ |
| 4126 | |
| 4127 | requires_gnutls |
| 4128 | run_test "DER format: with a trailing random byte" \ |
| 4129 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4130 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4131 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4132 | 0 \ |
| 4133 | -c "Handshake was completed" \ |
| 4134 | |
| 4135 | requires_gnutls |
| 4136 | run_test "DER format: with 2 trailing random bytes" \ |
| 4137 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4138 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4139 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4140 | 0 \ |
| 4141 | -c "Handshake was completed" \ |
| 4142 | |
| 4143 | requires_gnutls |
| 4144 | run_test "DER format: with 4 trailing random bytes" \ |
| 4145 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4146 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4147 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4148 | 0 \ |
| 4149 | -c "Handshake was completed" \ |
| 4150 | |
| 4151 | requires_gnutls |
| 4152 | run_test "DER format: with 8 trailing random bytes" \ |
| 4153 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4154 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4155 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4156 | 0 \ |
| 4157 | -c "Handshake was completed" \ |
| 4158 | |
| 4159 | requires_gnutls |
| 4160 | run_test "DER format: with 9 trailing random bytes" \ |
| 4161 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4162 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4163 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4164 | 0 \ |
| 4165 | -c "Handshake was completed" \ |
| 4166 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4167 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4168 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4169 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4170 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4171 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4172 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4173 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4174 | 1 \ |
| 4175 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4176 | -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] | 4177 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4178 | -c "X509 - Certificate verification failed" |
| 4179 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4180 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4181 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4182 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4183 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4184 | 0 \ |
| 4185 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4186 | -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] | 4187 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4188 | -C "X509 - Certificate verification failed" |
| 4189 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4190 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4191 | "$P_SRV" \ |
| 4192 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4193 | 0 \ |
| 4194 | -c "x509_verify_cert() returned" \ |
| 4195 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4196 | -c "! Certificate verification flags"\ |
| 4197 | -C "! mbedtls_ssl_handshake returned" \ |
| 4198 | -C "X509 - Certificate verification failed" \ |
| 4199 | -C "SSL - No CA Chain is set, but required to operate" |
| 4200 | |
| 4201 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4202 | "$P_SRV" \ |
| 4203 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4204 | 1 \ |
| 4205 | -c "x509_verify_cert() returned" \ |
| 4206 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4207 | -c "! Certificate verification flags"\ |
| 4208 | -c "! mbedtls_ssl_handshake returned" \ |
| 4209 | -c "SSL - No CA Chain is set, but required to operate" |
| 4210 | |
| 4211 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4212 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4213 | # the client informs the server about the supported curves - it does, though, in the |
| 4214 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4215 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4216 | # different means to have the server ignoring the client's supported curve list. |
| 4217 | |
| 4218 | requires_config_enabled MBEDTLS_ECP_C |
| 4219 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4220 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4221 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4222 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4223 | 1 \ |
| 4224 | -c "bad certificate (EC key curve)"\ |
| 4225 | -c "! Certificate verification flags"\ |
| 4226 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4227 | |
| 4228 | requires_config_enabled MBEDTLS_ECP_C |
| 4229 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4230 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4231 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4232 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4233 | 1 \ |
| 4234 | -c "bad certificate (EC key curve)"\ |
| 4235 | -c "! Certificate verification flags"\ |
| 4236 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4237 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4238 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4239 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4240 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4241 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4242 | 0 \ |
| 4243 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4244 | -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] | 4245 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4246 | -C "X509 - Certificate verification failed" |
| 4247 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4248 | run_test "Authentication: client SHA256, server required" \ |
| 4249 | "$P_SRV auth_mode=required" \ |
| 4250 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4251 | key_file=data_files/server6.key \ |
| 4252 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4253 | 0 \ |
| 4254 | -c "Supported Signature Algorithm found: 4," \ |
| 4255 | -c "Supported Signature Algorithm found: 5," |
| 4256 | |
| 4257 | run_test "Authentication: client SHA384, server required" \ |
| 4258 | "$P_SRV auth_mode=required" \ |
| 4259 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4260 | key_file=data_files/server6.key \ |
| 4261 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4262 | 0 \ |
| 4263 | -c "Supported Signature Algorithm found: 4," \ |
| 4264 | -c "Supported Signature Algorithm found: 5," |
| 4265 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4266 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4267 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4268 | "$P_CLI debug_level=3 crt_file=none \ |
| 4269 | key_file=data_files/server5.key" \ |
| 4270 | 1 \ |
| 4271 | -S "skip write certificate request" \ |
| 4272 | -C "skip parse certificate request" \ |
| 4273 | -c "got a certificate request" \ |
| 4274 | -c "= write certificate$" \ |
| 4275 | -C "skip write certificate$" \ |
| 4276 | -S "x509_verify_cert() returned" \ |
| 4277 | -s "client has no certificate" \ |
| 4278 | -s "! mbedtls_ssl_handshake returned" \ |
| 4279 | -c "! mbedtls_ssl_handshake returned" \ |
| 4280 | -s "No client certification received from the client, but required by the authentication mode" |
| 4281 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4282 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4283 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4284 | "$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] | 4285 | key_file=data_files/server5.key" \ |
| 4286 | 1 \ |
| 4287 | -S "skip write certificate request" \ |
| 4288 | -C "skip parse certificate request" \ |
| 4289 | -c "got a certificate request" \ |
| 4290 | -C "skip write certificate" \ |
| 4291 | -C "skip write certificate verify" \ |
| 4292 | -S "skip parse certificate verify" \ |
| 4293 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4294 | -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] | 4295 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4296 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4297 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4298 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4299 | # We don't check that the client receives the alert because it might |
| 4300 | # detect that its write end of the connection is closed and abort |
| 4301 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4302 | |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4303 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4304 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4305 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4306 | key_file=data_files/server5.key" \ |
| 4307 | 0 \ |
| 4308 | -S "skip write certificate request" \ |
| 4309 | -C "skip parse certificate request" \ |
| 4310 | -c "got a certificate request" \ |
| 4311 | -C "skip write certificate" \ |
| 4312 | -C "skip write certificate verify" \ |
| 4313 | -S "skip parse certificate verify" \ |
| 4314 | -S "x509_verify_cert() returned" \ |
| 4315 | -S "! The certificate is not correctly signed" \ |
| 4316 | -S "X509 - Certificate verification failed" |
| 4317 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4318 | run_test "Authentication: client cert not trusted, server required" \ |
| 4319 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4320 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4321 | key_file=data_files/server5.key" \ |
| 4322 | 1 \ |
| 4323 | -S "skip write certificate request" \ |
| 4324 | -C "skip parse certificate request" \ |
| 4325 | -c "got a certificate request" \ |
| 4326 | -C "skip write certificate" \ |
| 4327 | -C "skip write certificate verify" \ |
| 4328 | -S "skip parse certificate verify" \ |
| 4329 | -s "x509_verify_cert() returned" \ |
| 4330 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4331 | -s "! mbedtls_ssl_handshake returned" \ |
| 4332 | -c "! mbedtls_ssl_handshake returned" \ |
| 4333 | -s "X509 - Certificate verification failed" |
| 4334 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4335 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4336 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4337 | "$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] | 4338 | key_file=data_files/server5.key" \ |
| 4339 | 0 \ |
| 4340 | -S "skip write certificate request" \ |
| 4341 | -C "skip parse certificate request" \ |
| 4342 | -c "got a certificate request" \ |
| 4343 | -C "skip write certificate" \ |
| 4344 | -C "skip write certificate verify" \ |
| 4345 | -S "skip parse certificate verify" \ |
| 4346 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4347 | -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] | 4348 | -S "! mbedtls_ssl_handshake returned" \ |
| 4349 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4350 | -S "X509 - Certificate verification failed" |
| 4351 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4352 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4353 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4354 | "$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] | 4355 | key_file=data_files/server5.key" \ |
| 4356 | 0 \ |
| 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 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4364 | -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] | 4365 | -S "! mbedtls_ssl_handshake returned" \ |
| 4366 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4367 | -S "X509 - Certificate verification failed" |
| 4368 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4369 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4370 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4371 | "$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] | 4372 | 0 \ |
| 4373 | -S "skip write certificate request" \ |
| 4374 | -C "skip parse certificate request" \ |
| 4375 | -c "got a certificate request" \ |
| 4376 | -C "skip write certificate$" \ |
| 4377 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4378 | -c "skip write certificate verify" \ |
| 4379 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4380 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4381 | -S "! mbedtls_ssl_handshake returned" \ |
| 4382 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4383 | -S "X509 - Certificate verification failed" |
| 4384 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4385 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4386 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4387 | "$O_CLI" \ |
| 4388 | 0 \ |
| 4389 | -S "skip write certificate request" \ |
| 4390 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4391 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4392 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4393 | -S "X509 - Certificate verification failed" |
| 4394 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4395 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4396 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4397 | "$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] | 4398 | 0 \ |
| 4399 | -C "skip parse certificate request" \ |
| 4400 | -c "got a certificate request" \ |
| 4401 | -C "skip write certificate$" \ |
| 4402 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4403 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4404 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4405 | run_test "Authentication: client no cert, openssl server required" \ |
| 4406 | "$O_SRV -Verify 10" \ |
| 4407 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4408 | 1 \ |
| 4409 | -C "skip parse certificate request" \ |
| 4410 | -c "got a certificate request" \ |
| 4411 | -C "skip write certificate$" \ |
| 4412 | -c "skip write certificate verify" \ |
| 4413 | -c "! mbedtls_ssl_handshake returned" |
| 4414 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4415 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4416 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4417 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4418 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4419 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4420 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4421 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4422 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4423 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4424 | # 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] | 4425 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4426 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4427 | run_test "Authentication: server max_int chain, client default" \ |
| 4428 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4429 | key_file=data_files/dir-maxpath/09.key" \ |
| 4430 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4431 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4432 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4433 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4434 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4435 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4436 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4437 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4438 | key_file=data_files/dir-maxpath/10.key" \ |
| 4439 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4440 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4441 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4442 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4443 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4444 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4445 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4446 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4447 | key_file=data_files/dir-maxpath/10.key" \ |
| 4448 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4449 | auth_mode=optional" \ |
| 4450 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4451 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4452 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4453 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4454 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4455 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4456 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4457 | key_file=data_files/dir-maxpath/10.key" \ |
| 4458 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4459 | auth_mode=none" \ |
| 4460 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4461 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4462 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4463 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4464 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4465 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4466 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4467 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4468 | key_file=data_files/dir-maxpath/10.key" \ |
| 4469 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4470 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4471 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4472 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4473 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4474 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4475 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4476 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4477 | key_file=data_files/dir-maxpath/10.key" \ |
| 4478 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4479 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4480 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4481 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4482 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4483 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4484 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4485 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4486 | key_file=data_files/dir-maxpath/10.key" \ |
| 4487 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4488 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4489 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4490 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4491 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4492 | run_test "Authentication: client max_int chain, server required" \ |
| 4493 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4494 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4495 | key_file=data_files/dir-maxpath/09.key" \ |
| 4496 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4497 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4498 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4499 | # Tests for CA list in CertificateRequest messages |
| 4500 | |
| 4501 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4502 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4503 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4504 | key_file=data_files/server6.key" \ |
| 4505 | 0 \ |
| 4506 | -s "requested DN" |
| 4507 | |
| 4508 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4509 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4510 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4511 | key_file=data_files/server6.key" \ |
| 4512 | 0 \ |
| 4513 | -S "requested DN" |
| 4514 | |
| 4515 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4516 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4517 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4518 | key_file=data_files/server5.key" \ |
| 4519 | 1 \ |
| 4520 | -S "requested DN" \ |
| 4521 | -s "x509_verify_cert() returned" \ |
| 4522 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4523 | -s "! mbedtls_ssl_handshake returned" \ |
| 4524 | -c "! mbedtls_ssl_handshake returned" \ |
| 4525 | -s "X509 - Certificate verification failed" |
| 4526 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4527 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4528 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4529 | |
| 4530 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4531 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4532 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4533 | key_file=data_files/server5.key" \ |
| 4534 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4535 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4536 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4537 | -c "x509_verify_cert() returned" \ |
| 4538 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4539 | -c "! mbedtls_ssl_handshake returned" \ |
| 4540 | -c "X509 - Certificate verification failed" |
| 4541 | |
| 4542 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4543 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4544 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4545 | key_file=data_files/server5.key" \ |
| 4546 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4547 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4548 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4549 | -c "x509_verify_cert() returned" \ |
| 4550 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4551 | -C "! mbedtls_ssl_handshake returned" \ |
| 4552 | -C "X509 - Certificate verification failed" |
| 4553 | |
| 4554 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4555 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4556 | # the client informs the server about the supported curves - it does, though, in the |
| 4557 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4558 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4559 | # different means to have the server ignoring the client's supported curve list. |
| 4560 | |
| 4561 | requires_config_enabled MBEDTLS_ECP_C |
| 4562 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4563 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4564 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4565 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4566 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4567 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4568 | -c "use CA callback for X.509 CRT verification" \ |
| 4569 | -c "bad certificate (EC key curve)" \ |
| 4570 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4571 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4572 | |
| 4573 | requires_config_enabled MBEDTLS_ECP_C |
| 4574 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4575 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4576 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4577 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4578 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4579 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4580 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4581 | -c "bad certificate (EC key curve)"\ |
| 4582 | -c "! Certificate verification flags"\ |
| 4583 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4584 | |
| 4585 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4586 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4587 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4588 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4589 | key_file=data_files/server6.key \ |
| 4590 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4591 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4592 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4593 | -c "Supported Signature Algorithm found: 4," \ |
| 4594 | -c "Supported Signature Algorithm found: 5," |
| 4595 | |
| 4596 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4597 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4598 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4599 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4600 | key_file=data_files/server6.key \ |
| 4601 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4602 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4603 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4604 | -c "Supported Signature Algorithm found: 4," \ |
| 4605 | -c "Supported Signature Algorithm found: 5," |
| 4606 | |
| 4607 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4608 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4609 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4610 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4611 | key_file=data_files/server5.key" \ |
| 4612 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4613 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4614 | -S "skip write certificate request" \ |
| 4615 | -C "skip parse certificate request" \ |
| 4616 | -c "got a certificate request" \ |
| 4617 | -C "skip write certificate" \ |
| 4618 | -C "skip write certificate verify" \ |
| 4619 | -S "skip parse certificate verify" \ |
| 4620 | -s "x509_verify_cert() returned" \ |
| 4621 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4622 | -s "! mbedtls_ssl_handshake returned" \ |
| 4623 | -s "send alert level=2 message=48" \ |
| 4624 | -c "! mbedtls_ssl_handshake returned" \ |
| 4625 | -s "X509 - Certificate verification failed" |
| 4626 | # We don't check that the client receives the alert because it might |
| 4627 | # detect that its write end of the connection is closed and abort |
| 4628 | # before reading the alert message. |
| 4629 | |
| 4630 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4631 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4632 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4633 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4634 | key_file=data_files/server5.key" \ |
| 4635 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4636 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4637 | -S "skip write certificate request" \ |
| 4638 | -C "skip parse certificate request" \ |
| 4639 | -c "got a certificate request" \ |
| 4640 | -C "skip write certificate" \ |
| 4641 | -C "skip write certificate verify" \ |
| 4642 | -S "skip parse certificate verify" \ |
| 4643 | -s "x509_verify_cert() returned" \ |
| 4644 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4645 | -s "! mbedtls_ssl_handshake returned" \ |
| 4646 | -c "! mbedtls_ssl_handshake returned" \ |
| 4647 | -s "X509 - Certificate verification failed" |
| 4648 | |
| 4649 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4650 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4651 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4652 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4653 | key_file=data_files/server5.key" \ |
| 4654 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4655 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4656 | -S "skip write certificate request" \ |
| 4657 | -C "skip parse certificate request" \ |
| 4658 | -c "got a certificate request" \ |
| 4659 | -C "skip write certificate" \ |
| 4660 | -C "skip write certificate verify" \ |
| 4661 | -S "skip parse certificate verify" \ |
| 4662 | -s "x509_verify_cert() returned" \ |
| 4663 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4664 | -S "! mbedtls_ssl_handshake returned" \ |
| 4665 | -C "! mbedtls_ssl_handshake returned" \ |
| 4666 | -S "X509 - Certificate verification failed" |
| 4667 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4668 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4669 | requires_full_size_output_buffer |
| 4670 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4671 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4672 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4673 | key_file=data_files/dir-maxpath/09.key" \ |
| 4674 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4675 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4676 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4677 | -C "X509 - A fatal error occurred" |
| 4678 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4679 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4680 | requires_full_size_output_buffer |
| 4681 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4682 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4683 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4684 | key_file=data_files/dir-maxpath/10.key" \ |
| 4685 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4686 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4687 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4688 | -c "X509 - A fatal error occurred" |
| 4689 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4690 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4691 | requires_full_size_output_buffer |
| 4692 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4693 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4694 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4695 | key_file=data_files/dir-maxpath/10.key" \ |
| 4696 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4697 | debug_level=3 auth_mode=optional" \ |
| 4698 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4699 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4700 | -c "X509 - A fatal error occurred" |
| 4701 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4702 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4703 | requires_full_size_output_buffer |
| 4704 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4705 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4706 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4707 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4708 | key_file=data_files/dir-maxpath/10.key" \ |
| 4709 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4710 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4711 | -s "X509 - A fatal error occurred" |
| 4712 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4713 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4714 | requires_full_size_output_buffer |
| 4715 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4716 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4717 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4718 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4719 | key_file=data_files/dir-maxpath/10.key" \ |
| 4720 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4721 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4722 | -s "X509 - A fatal error occurred" |
| 4723 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4724 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4725 | requires_full_size_output_buffer |
| 4726 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4727 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4728 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4729 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4730 | key_file=data_files/dir-maxpath/09.key" \ |
| 4731 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4732 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4733 | -S "X509 - A fatal error occurred" |
| 4734 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4735 | # Tests for certificate selection based on SHA verson |
| 4736 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4737 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4738 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4739 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4740 | key_file=data_files/server5.key \ |
| 4741 | crt_file2=data_files/server5-sha1.crt \ |
| 4742 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 4743 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4744 | 0 \ |
| 4745 | -c "signed using.*ECDSA with SHA256" \ |
| 4746 | -C "signed using.*ECDSA with SHA1" |
| 4747 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4748 | # tests for SNI |
| 4749 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4750 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4751 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4752 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4753 | 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] | 4754 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4755 | 0 \ |
| 4756 | -S "parse ServerName extension" \ |
| 4757 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4758 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4759 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4760 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4761 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4762 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4763 | 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] | 4764 | 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] | 4765 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4766 | 0 \ |
| 4767 | -s "parse ServerName extension" \ |
| 4768 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4769 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4770 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4771 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4772 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4773 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4774 | 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] | 4775 | 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] | 4776 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4777 | 0 \ |
| 4778 | -s "parse ServerName extension" \ |
| 4779 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4780 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4781 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4782 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4783 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4784 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4785 | 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] | 4786 | 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] | 4787 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4788 | 1 \ |
| 4789 | -s "parse ServerName extension" \ |
| 4790 | -s "ssl_sni_wrapper() returned" \ |
| 4791 | -s "mbedtls_ssl_handshake returned" \ |
| 4792 | -c "mbedtls_ssl_handshake returned" \ |
| 4793 | -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] | 4794 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4795 | run_test "SNI: client auth no override: optional" \ |
| 4796 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4797 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4798 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4799 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4800 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4801 | -S "skip write certificate request" \ |
| 4802 | -C "skip parse certificate request" \ |
| 4803 | -c "got a certificate request" \ |
| 4804 | -C "skip write certificate" \ |
| 4805 | -C "skip write certificate verify" \ |
| 4806 | -S "skip parse certificate verify" |
| 4807 | |
| 4808 | run_test "SNI: client auth override: none -> optional" \ |
| 4809 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4810 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4811 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4812 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4813 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4814 | -S "skip write certificate request" \ |
| 4815 | -C "skip parse certificate request" \ |
| 4816 | -c "got a certificate request" \ |
| 4817 | -C "skip write certificate" \ |
| 4818 | -C "skip write certificate verify" \ |
| 4819 | -S "skip parse certificate verify" |
| 4820 | |
| 4821 | run_test "SNI: client auth override: optional -> none" \ |
| 4822 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4823 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4824 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4825 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4826 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4827 | -s "skip write certificate request" \ |
| 4828 | -C "skip parse certificate request" \ |
| 4829 | -c "got no certificate request" \ |
| 4830 | -c "skip write certificate" \ |
| 4831 | -c "skip write certificate verify" \ |
| 4832 | -s "skip parse certificate verify" |
| 4833 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4834 | run_test "SNI: CA no override" \ |
| 4835 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4836 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4837 | ca_file=data_files/test-ca.crt \ |
| 4838 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4839 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4840 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4841 | 1 \ |
| 4842 | -S "skip write certificate request" \ |
| 4843 | -C "skip parse certificate request" \ |
| 4844 | -c "got a certificate request" \ |
| 4845 | -C "skip write certificate" \ |
| 4846 | -C "skip write certificate verify" \ |
| 4847 | -S "skip parse certificate verify" \ |
| 4848 | -s "x509_verify_cert() returned" \ |
| 4849 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4850 | -S "The certificate has been revoked (is on a CRL)" |
| 4851 | |
| 4852 | run_test "SNI: CA override" \ |
| 4853 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4854 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4855 | ca_file=data_files/test-ca.crt \ |
| 4856 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4857 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4858 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4859 | 0 \ |
| 4860 | -S "skip write certificate request" \ |
| 4861 | -C "skip parse certificate request" \ |
| 4862 | -c "got a certificate request" \ |
| 4863 | -C "skip write certificate" \ |
| 4864 | -C "skip write certificate verify" \ |
| 4865 | -S "skip parse certificate verify" \ |
| 4866 | -S "x509_verify_cert() returned" \ |
| 4867 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4868 | -S "The certificate has been revoked (is on a CRL)" |
| 4869 | |
| 4870 | run_test "SNI: CA override with CRL" \ |
| 4871 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4872 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4873 | ca_file=data_files/test-ca.crt \ |
| 4874 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4875 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4876 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4877 | 1 \ |
| 4878 | -S "skip write certificate request" \ |
| 4879 | -C "skip parse certificate request" \ |
| 4880 | -c "got a certificate request" \ |
| 4881 | -C "skip write certificate" \ |
| 4882 | -C "skip write certificate verify" \ |
| 4883 | -S "skip parse certificate verify" \ |
| 4884 | -s "x509_verify_cert() returned" \ |
| 4885 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4886 | -s "The certificate has been revoked (is on a CRL)" |
| 4887 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4888 | # Tests for SNI and DTLS |
| 4889 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4890 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4891 | run_test "SNI: DTLS, no SNI callback" \ |
| 4892 | "$P_SRV debug_level=3 dtls=1 \ |
| 4893 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4894 | "$P_CLI server_name=localhost dtls=1" \ |
| 4895 | 0 \ |
| 4896 | -S "parse ServerName extension" \ |
| 4897 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4898 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4899 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4900 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4901 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4902 | "$P_SRV debug_level=3 dtls=1 \ |
| 4903 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4904 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4905 | "$P_CLI server_name=localhost dtls=1" \ |
| 4906 | 0 \ |
| 4907 | -s "parse ServerName extension" \ |
| 4908 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4909 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4910 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4911 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4912 | run_test "SNI: DTLS, matching cert 2" \ |
| 4913 | "$P_SRV debug_level=3 dtls=1 \ |
| 4914 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4915 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4916 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4917 | 0 \ |
| 4918 | -s "parse ServerName extension" \ |
| 4919 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4920 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4921 | |
| 4922 | run_test "SNI: DTLS, no matching cert" \ |
| 4923 | "$P_SRV debug_level=3 dtls=1 \ |
| 4924 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4925 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4926 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4927 | 1 \ |
| 4928 | -s "parse ServerName extension" \ |
| 4929 | -s "ssl_sni_wrapper() returned" \ |
| 4930 | -s "mbedtls_ssl_handshake returned" \ |
| 4931 | -c "mbedtls_ssl_handshake returned" \ |
| 4932 | -c "SSL - A fatal alert message was received from our peer" |
| 4933 | |
| 4934 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4935 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4936 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4937 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4938 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4939 | 0 \ |
| 4940 | -S "skip write certificate request" \ |
| 4941 | -C "skip parse certificate request" \ |
| 4942 | -c "got a certificate request" \ |
| 4943 | -C "skip write certificate" \ |
| 4944 | -C "skip write certificate verify" \ |
| 4945 | -S "skip parse certificate verify" |
| 4946 | |
| 4947 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4948 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4949 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4950 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4951 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4952 | 0 \ |
| 4953 | -S "skip write certificate request" \ |
| 4954 | -C "skip parse certificate request" \ |
| 4955 | -c "got a certificate request" \ |
| 4956 | -C "skip write certificate" \ |
| 4957 | -C "skip write certificate verify" \ |
| 4958 | -S "skip parse certificate verify" |
| 4959 | |
| 4960 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4961 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4962 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4963 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4964 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4965 | 0 \ |
| 4966 | -s "skip write certificate request" \ |
| 4967 | -C "skip parse certificate request" \ |
| 4968 | -c "got no certificate request" \ |
| 4969 | -c "skip write certificate" \ |
| 4970 | -c "skip write certificate verify" \ |
| 4971 | -s "skip parse certificate verify" |
| 4972 | |
| 4973 | run_test "SNI: DTLS, CA no override" \ |
| 4974 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4975 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4976 | ca_file=data_files/test-ca.crt \ |
| 4977 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4978 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4979 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4980 | 1 \ |
| 4981 | -S "skip write certificate request" \ |
| 4982 | -C "skip parse certificate request" \ |
| 4983 | -c "got a certificate request" \ |
| 4984 | -C "skip write certificate" \ |
| 4985 | -C "skip write certificate verify" \ |
| 4986 | -S "skip parse certificate verify" \ |
| 4987 | -s "x509_verify_cert() returned" \ |
| 4988 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4989 | -S "The certificate has been revoked (is on a CRL)" |
| 4990 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4991 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4992 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4993 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4994 | ca_file=data_files/test-ca.crt \ |
| 4995 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4996 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4997 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4998 | 0 \ |
| 4999 | -S "skip write certificate request" \ |
| 5000 | -C "skip parse certificate request" \ |
| 5001 | -c "got a certificate request" \ |
| 5002 | -C "skip write certificate" \ |
| 5003 | -C "skip write certificate verify" \ |
| 5004 | -S "skip parse certificate verify" \ |
| 5005 | -S "x509_verify_cert() returned" \ |
| 5006 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5007 | -S "The certificate has been revoked (is on a CRL)" |
| 5008 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5009 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5010 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5011 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5012 | ca_file=data_files/test-ca.crt \ |
| 5013 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5014 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5015 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5016 | 1 \ |
| 5017 | -S "skip write certificate request" \ |
| 5018 | -C "skip parse certificate request" \ |
| 5019 | -c "got a certificate request" \ |
| 5020 | -C "skip write certificate" \ |
| 5021 | -C "skip write certificate verify" \ |
| 5022 | -S "skip parse certificate verify" \ |
| 5023 | -s "x509_verify_cert() returned" \ |
| 5024 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5025 | -s "The certificate has been revoked (is on a CRL)" |
| 5026 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5027 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5028 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5029 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5030 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5031 | "$P_CLI nbio=2 tickets=0" \ |
| 5032 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5033 | -S "mbedtls_ssl_handshake returned" \ |
| 5034 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5035 | -c "Read from server: .* bytes read" |
| 5036 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5037 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5038 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5039 | "$P_CLI nbio=2 tickets=0" \ |
| 5040 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5041 | -S "mbedtls_ssl_handshake returned" \ |
| 5042 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5043 | -c "Read from server: .* bytes read" |
| 5044 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5045 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5046 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5047 | "$P_CLI nbio=2 tickets=1" \ |
| 5048 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5049 | -S "mbedtls_ssl_handshake returned" \ |
| 5050 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5051 | -c "Read from server: .* bytes read" |
| 5052 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5053 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5054 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5055 | "$P_CLI nbio=2 tickets=1" \ |
| 5056 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5057 | -S "mbedtls_ssl_handshake returned" \ |
| 5058 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5059 | -c "Read from server: .* bytes read" |
| 5060 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5061 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5062 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5063 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5064 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5065 | -S "mbedtls_ssl_handshake returned" \ |
| 5066 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5067 | -c "Read from server: .* bytes read" |
| 5068 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5069 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5070 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5071 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5072 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5073 | -S "mbedtls_ssl_handshake returned" \ |
| 5074 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5075 | -c "Read from server: .* bytes read" |
| 5076 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5077 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5078 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5079 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5080 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5081 | -S "mbedtls_ssl_handshake returned" \ |
| 5082 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5083 | -c "Read from server: .* bytes read" |
| 5084 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5085 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5086 | |
| 5087 | run_test "Event-driven I/O: basic handshake" \ |
| 5088 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5089 | "$P_CLI event=1 tickets=0" \ |
| 5090 | 0 \ |
| 5091 | -S "mbedtls_ssl_handshake returned" \ |
| 5092 | -C "mbedtls_ssl_handshake returned" \ |
| 5093 | -c "Read from server: .* bytes read" |
| 5094 | |
| 5095 | run_test "Event-driven I/O: client auth" \ |
| 5096 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5097 | "$P_CLI event=1 tickets=0" \ |
| 5098 | 0 \ |
| 5099 | -S "mbedtls_ssl_handshake returned" \ |
| 5100 | -C "mbedtls_ssl_handshake returned" \ |
| 5101 | -c "Read from server: .* bytes read" |
| 5102 | |
| 5103 | run_test "Event-driven I/O: ticket" \ |
| 5104 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5105 | "$P_CLI event=1 tickets=1" \ |
| 5106 | 0 \ |
| 5107 | -S "mbedtls_ssl_handshake returned" \ |
| 5108 | -C "mbedtls_ssl_handshake returned" \ |
| 5109 | -c "Read from server: .* bytes read" |
| 5110 | |
| 5111 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5112 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5113 | "$P_CLI event=1 tickets=1" \ |
| 5114 | 0 \ |
| 5115 | -S "mbedtls_ssl_handshake returned" \ |
| 5116 | -C "mbedtls_ssl_handshake returned" \ |
| 5117 | -c "Read from server: .* bytes read" |
| 5118 | |
| 5119 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5120 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5121 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5122 | 0 \ |
| 5123 | -S "mbedtls_ssl_handshake returned" \ |
| 5124 | -C "mbedtls_ssl_handshake returned" \ |
| 5125 | -c "Read from server: .* bytes read" |
| 5126 | |
| 5127 | run_test "Event-driven I/O: ticket + resume" \ |
| 5128 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5129 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5130 | 0 \ |
| 5131 | -S "mbedtls_ssl_handshake returned" \ |
| 5132 | -C "mbedtls_ssl_handshake returned" \ |
| 5133 | -c "Read from server: .* bytes read" |
| 5134 | |
| 5135 | run_test "Event-driven I/O: session-id resume" \ |
| 5136 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5137 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5138 | 0 \ |
| 5139 | -S "mbedtls_ssl_handshake returned" \ |
| 5140 | -C "mbedtls_ssl_handshake returned" \ |
| 5141 | -c "Read from server: .* bytes read" |
| 5142 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5143 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5144 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5145 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5146 | 0 \ |
| 5147 | -c "Read from server: .* bytes read" |
| 5148 | |
| 5149 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5150 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5151 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5152 | 0 \ |
| 5153 | -c "Read from server: .* bytes read" |
| 5154 | |
| 5155 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5156 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5157 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5158 | 0 \ |
| 5159 | -c "Read from server: .* bytes read" |
| 5160 | |
| 5161 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5162 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5163 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5164 | 0 \ |
| 5165 | -c "Read from server: .* bytes read" |
| 5166 | |
| 5167 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5168 | "$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] | 5169 | "$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] | 5170 | 0 \ |
| 5171 | -c "Read from server: .* bytes read" |
| 5172 | |
| 5173 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5174 | "$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] | 5175 | "$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] | 5176 | 0 \ |
| 5177 | -c "Read from server: .* bytes read" |
| 5178 | |
| 5179 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5180 | "$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] | 5181 | "$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] | 5182 | 0 \ |
| 5183 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5184 | |
| 5185 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5186 | # During session resumption, the client will send its ApplicationData record |
| 5187 | # within the same datagram as the Finished messages. In this situation, the |
| 5188 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5189 | # because the ApplicationData request has already been queued internally. |
| 5190 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5191 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5192 | "$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] | 5193 | "$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] | 5194 | 0 \ |
| 5195 | -c "Read from server: .* bytes read" |
| 5196 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5197 | # Tests for version negotiation |
| 5198 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5199 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5200 | "$P_SRV" \ |
| 5201 | "$P_CLI" \ |
| 5202 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5203 | -S "mbedtls_ssl_handshake returned" \ |
| 5204 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5205 | -s "Protocol is TLSv1.2" \ |
| 5206 | -c "Protocol is TLSv1.2" |
| 5207 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 5208 | run_test "Not supported version check: cli TLS 1.0" \ |
| 5209 | "$P_SRV" \ |
| 5210 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 5211 | 1 \ |
| 5212 | -s "Handshake protocol not within min/max boundaries" \ |
| 5213 | -c "Error in protocol version" \ |
| 5214 | -S "Protocol is TLSv1.0" \ |
| 5215 | -C "Handshake was completed" |
| 5216 | |
| 5217 | run_test "Not supported version check: cli TLS 1.1" \ |
| 5218 | "$P_SRV" \ |
| 5219 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 5220 | 1 \ |
| 5221 | -s "Handshake protocol not within min/max boundaries" \ |
| 5222 | -c "Error in protocol version" \ |
| 5223 | -S "Protocol is TLSv1.1" \ |
| 5224 | -C "Handshake was completed" |
| 5225 | |
| 5226 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 5227 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 5228 | "$P_CLI" \ |
| 5229 | 1 \ |
| 5230 | -s "Error in protocol version" \ |
| 5231 | -c "Handshake protocol not within min/max boundaries" \ |
| 5232 | -S "Version: TLS1.0" \ |
| 5233 | -C "Protocol is TLSv1.0" |
| 5234 | |
| 5235 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 5236 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 5237 | "$P_CLI" \ |
| 5238 | 1 \ |
| 5239 | -s "Error in protocol version" \ |
| 5240 | -c "Handshake protocol not within min/max boundaries" \ |
| 5241 | -S "Version: TLS1.1" \ |
| 5242 | -C "Protocol is TLSv1.1" |
| 5243 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5244 | # Tests for ALPN extension |
| 5245 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5246 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5247 | "$P_SRV debug_level=3" \ |
| 5248 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5249 | 0 \ |
| 5250 | -C "client hello, adding alpn extension" \ |
| 5251 | -S "found alpn extension" \ |
| 5252 | -C "got an alert message, type: \\[2:120]" \ |
| 5253 | -S "server hello, adding alpn extension" \ |
| 5254 | -C "found alpn extension " \ |
| 5255 | -C "Application Layer Protocol is" \ |
| 5256 | -S "Application Layer Protocol is" |
| 5257 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5258 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5259 | "$P_SRV debug_level=3" \ |
| 5260 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5261 | 0 \ |
| 5262 | -c "client hello, adding alpn extension" \ |
| 5263 | -s "found alpn extension" \ |
| 5264 | -C "got an alert message, type: \\[2:120]" \ |
| 5265 | -S "server hello, adding alpn extension" \ |
| 5266 | -C "found alpn extension " \ |
| 5267 | -c "Application Layer Protocol is (none)" \ |
| 5268 | -S "Application Layer Protocol is" |
| 5269 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5270 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5271 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5272 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5273 | 0 \ |
| 5274 | -C "client hello, adding alpn extension" \ |
| 5275 | -S "found alpn extension" \ |
| 5276 | -C "got an alert message, type: \\[2:120]" \ |
| 5277 | -S "server hello, adding alpn extension" \ |
| 5278 | -C "found alpn extension " \ |
| 5279 | -C "Application Layer Protocol is" \ |
| 5280 | -s "Application Layer Protocol is (none)" |
| 5281 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5282 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5283 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5284 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5285 | 0 \ |
| 5286 | -c "client hello, adding alpn extension" \ |
| 5287 | -s "found alpn extension" \ |
| 5288 | -C "got an alert message, type: \\[2:120]" \ |
| 5289 | -s "server hello, adding alpn extension" \ |
| 5290 | -c "found alpn extension" \ |
| 5291 | -c "Application Layer Protocol is abc" \ |
| 5292 | -s "Application Layer Protocol is abc" |
| 5293 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5294 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5295 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5296 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5297 | 0 \ |
| 5298 | -c "client hello, adding alpn extension" \ |
| 5299 | -s "found alpn extension" \ |
| 5300 | -C "got an alert message, type: \\[2:120]" \ |
| 5301 | -s "server hello, adding alpn extension" \ |
| 5302 | -c "found alpn extension" \ |
| 5303 | -c "Application Layer Protocol is abc" \ |
| 5304 | -s "Application Layer Protocol is abc" |
| 5305 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5306 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5307 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5308 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5309 | 0 \ |
| 5310 | -c "client hello, adding alpn extension" \ |
| 5311 | -s "found alpn extension" \ |
| 5312 | -C "got an alert message, type: \\[2:120]" \ |
| 5313 | -s "server hello, adding alpn extension" \ |
| 5314 | -c "found alpn extension" \ |
| 5315 | -c "Application Layer Protocol is 1234" \ |
| 5316 | -s "Application Layer Protocol is 1234" |
| 5317 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5318 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5319 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5320 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5321 | 1 \ |
| 5322 | -c "client hello, adding alpn extension" \ |
| 5323 | -s "found alpn extension" \ |
| 5324 | -c "got an alert message, type: \\[2:120]" \ |
| 5325 | -S "server hello, adding alpn extension" \ |
| 5326 | -C "found alpn extension" \ |
| 5327 | -C "Application Layer Protocol is 1234" \ |
| 5328 | -S "Application Layer Protocol is 1234" |
| 5329 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5330 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5331 | # Tests for keyUsage in leaf certificates, part 1: |
| 5332 | # server-side certificate/suite selection |
| 5333 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5334 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5335 | "$P_SRV key_file=data_files/server2.key \ |
| 5336 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5337 | "$P_CLI" \ |
| 5338 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5339 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5340 | |
| 5341 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5342 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5343 | "$P_SRV key_file=data_files/server2.key \ |
| 5344 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5345 | "$P_CLI" \ |
| 5346 | 0 \ |
| 5347 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5348 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5349 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5350 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5351 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5352 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5353 | 1 \ |
| 5354 | -C "Ciphersuite is " |
| 5355 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5356 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5357 | "$P_SRV key_file=data_files/server5.key \ |
| 5358 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5359 | "$P_CLI" \ |
| 5360 | 0 \ |
| 5361 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5362 | |
| 5363 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5364 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5365 | "$P_SRV key_file=data_files/server5.key \ |
| 5366 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5367 | "$P_CLI" \ |
| 5368 | 0 \ |
| 5369 | -c "Ciphersuite is TLS-ECDH-" |
| 5370 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5371 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5372 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5373 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5374 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5375 | 1 \ |
| 5376 | -C "Ciphersuite is " |
| 5377 | |
| 5378 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5379 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5380 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5381 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5382 | "$O_SRV -key data_files/server2.key \ |
| 5383 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5384 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5385 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5386 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5387 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5388 | -C "Processing of the Certificate handshake message failed" \ |
| 5389 | -c "Ciphersuite is TLS-" |
| 5390 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5391 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5392 | "$O_SRV -key data_files/server2.key \ |
| 5393 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5394 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5395 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5396 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5397 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5398 | -C "Processing of the Certificate handshake message failed" \ |
| 5399 | -c "Ciphersuite is TLS-" |
| 5400 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5401 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5402 | "$O_SRV -key data_files/server2.key \ |
| 5403 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5404 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5405 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5406 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5407 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5408 | -C "Processing of the Certificate handshake message failed" \ |
| 5409 | -c "Ciphersuite is TLS-" |
| 5410 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5411 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5412 | "$O_SRV -key data_files/server2.key \ |
| 5413 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5414 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5415 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5416 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5417 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5418 | -c "Processing of the Certificate handshake message failed" \ |
| 5419 | -C "Ciphersuite is TLS-" |
| 5420 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5421 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5422 | "$O_SRV -key data_files/server2.key \ |
| 5423 | -cert data_files/server2.ku-ke.crt" \ |
| 5424 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5425 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5426 | 0 \ |
| 5427 | -c "bad certificate (usage extensions)" \ |
| 5428 | -C "Processing of the Certificate handshake message failed" \ |
| 5429 | -c "Ciphersuite is TLS-" \ |
| 5430 | -c "! Usage does not match the keyUsage extension" |
| 5431 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5432 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5433 | "$O_SRV -key data_files/server2.key \ |
| 5434 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5435 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5436 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5437 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5438 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5439 | -C "Processing of the Certificate handshake message failed" \ |
| 5440 | -c "Ciphersuite is TLS-" |
| 5441 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5442 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5443 | "$O_SRV -key data_files/server2.key \ |
| 5444 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5445 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5446 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5447 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5448 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5449 | -c "Processing of the Certificate handshake message failed" \ |
| 5450 | -C "Ciphersuite is TLS-" |
| 5451 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5452 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5453 | "$O_SRV -key data_files/server2.key \ |
| 5454 | -cert data_files/server2.ku-ds.crt" \ |
| 5455 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5456 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5457 | 0 \ |
| 5458 | -c "bad certificate (usage extensions)" \ |
| 5459 | -C "Processing of the Certificate handshake message failed" \ |
| 5460 | -c "Ciphersuite is TLS-" \ |
| 5461 | -c "! Usage does not match the keyUsage extension" |
| 5462 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5463 | # Tests for keyUsage in leaf certificates, part 3: |
| 5464 | # server-side checking of client cert |
| 5465 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5466 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5467 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5468 | "$O_CLI -key data_files/server2.key \ |
| 5469 | -cert data_files/server2.ku-ds.crt" \ |
| 5470 | 0 \ |
| 5471 | -S "bad certificate (usage extensions)" \ |
| 5472 | -S "Processing of the Certificate handshake message failed" |
| 5473 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5474 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5475 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5476 | "$O_CLI -key data_files/server2.key \ |
| 5477 | -cert data_files/server2.ku-ke.crt" \ |
| 5478 | 0 \ |
| 5479 | -s "bad certificate (usage extensions)" \ |
| 5480 | -S "Processing of the Certificate handshake message failed" |
| 5481 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5482 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5483 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5484 | "$O_CLI -key data_files/server2.key \ |
| 5485 | -cert data_files/server2.ku-ke.crt" \ |
| 5486 | 1 \ |
| 5487 | -s "bad certificate (usage extensions)" \ |
| 5488 | -s "Processing of the Certificate handshake message failed" |
| 5489 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5490 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5491 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5492 | "$O_CLI -key data_files/server5.key \ |
| 5493 | -cert data_files/server5.ku-ds.crt" \ |
| 5494 | 0 \ |
| 5495 | -S "bad certificate (usage extensions)" \ |
| 5496 | -S "Processing of the Certificate handshake message failed" |
| 5497 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5498 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5499 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5500 | "$O_CLI -key data_files/server5.key \ |
| 5501 | -cert data_files/server5.ku-ka.crt" \ |
| 5502 | 0 \ |
| 5503 | -s "bad certificate (usage extensions)" \ |
| 5504 | -S "Processing of the Certificate handshake message failed" |
| 5505 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5506 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5507 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5508 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5509 | "$P_SRV key_file=data_files/server5.key \ |
| 5510 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5511 | "$P_CLI" \ |
| 5512 | 0 |
| 5513 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5514 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5515 | "$P_SRV key_file=data_files/server5.key \ |
| 5516 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5517 | "$P_CLI" \ |
| 5518 | 0 |
| 5519 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5520 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5521 | "$P_SRV key_file=data_files/server5.key \ |
| 5522 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5523 | "$P_CLI" \ |
| 5524 | 0 |
| 5525 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5526 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5527 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5528 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5529 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5530 | 1 |
| 5531 | |
| 5532 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5533 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5534 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5535 | "$O_SRV -key data_files/server5.key \ |
| 5536 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5537 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5538 | 0 \ |
| 5539 | -C "bad certificate (usage extensions)" \ |
| 5540 | -C "Processing of the Certificate handshake message failed" \ |
| 5541 | -c "Ciphersuite is TLS-" |
| 5542 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5543 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5544 | "$O_SRV -key data_files/server5.key \ |
| 5545 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5546 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5547 | 0 \ |
| 5548 | -C "bad certificate (usage extensions)" \ |
| 5549 | -C "Processing of the Certificate handshake message failed" \ |
| 5550 | -c "Ciphersuite is TLS-" |
| 5551 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5552 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5553 | "$O_SRV -key data_files/server5.key \ |
| 5554 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5555 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5556 | 0 \ |
| 5557 | -C "bad certificate (usage extensions)" \ |
| 5558 | -C "Processing of the Certificate handshake message failed" \ |
| 5559 | -c "Ciphersuite is TLS-" |
| 5560 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5561 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5562 | "$O_SRV -key data_files/server5.key \ |
| 5563 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5564 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5565 | 1 \ |
| 5566 | -c "bad certificate (usage extensions)" \ |
| 5567 | -c "Processing of the Certificate handshake message failed" \ |
| 5568 | -C "Ciphersuite is TLS-" |
| 5569 | |
| 5570 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5571 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5572 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5573 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5574 | "$O_CLI -key data_files/server5.key \ |
| 5575 | -cert data_files/server5.eku-cli.crt" \ |
| 5576 | 0 \ |
| 5577 | -S "bad certificate (usage extensions)" \ |
| 5578 | -S "Processing of the Certificate handshake message failed" |
| 5579 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5580 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5581 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5582 | "$O_CLI -key data_files/server5.key \ |
| 5583 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5584 | 0 \ |
| 5585 | -S "bad certificate (usage extensions)" \ |
| 5586 | -S "Processing of the Certificate handshake message failed" |
| 5587 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5588 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5589 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5590 | "$O_CLI -key data_files/server5.key \ |
| 5591 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5592 | 0 \ |
| 5593 | -S "bad certificate (usage extensions)" \ |
| 5594 | -S "Processing of the Certificate handshake message failed" |
| 5595 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5596 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5597 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5598 | "$O_CLI -key data_files/server5.key \ |
| 5599 | -cert data_files/server5.eku-cs.crt" \ |
| 5600 | 0 \ |
| 5601 | -s "bad certificate (usage extensions)" \ |
| 5602 | -S "Processing of the Certificate handshake message failed" |
| 5603 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5604 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5605 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5606 | "$O_CLI -key data_files/server5.key \ |
| 5607 | -cert data_files/server5.eku-cs.crt" \ |
| 5608 | 1 \ |
| 5609 | -s "bad certificate (usage extensions)" \ |
| 5610 | -s "Processing of the Certificate handshake message failed" |
| 5611 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5612 | # Tests for DHM parameters loading |
| 5613 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5614 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5615 | "$P_SRV" \ |
| 5616 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5617 | debug_level=3" \ |
| 5618 | 0 \ |
| 5619 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5620 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5621 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5622 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5623 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5624 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5625 | debug_level=3" \ |
| 5626 | 0 \ |
| 5627 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5628 | -c "value of 'DHM: G ' (2 bits)" |
| 5629 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5630 | # Tests for DHM client-side size checking |
| 5631 | |
| 5632 | run_test "DHM size: server default, client default, OK" \ |
| 5633 | "$P_SRV" \ |
| 5634 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5635 | debug_level=1" \ |
| 5636 | 0 \ |
| 5637 | -C "DHM prime too short:" |
| 5638 | |
| 5639 | run_test "DHM size: server default, client 2048, OK" \ |
| 5640 | "$P_SRV" \ |
| 5641 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5642 | debug_level=1 dhmlen=2048" \ |
| 5643 | 0 \ |
| 5644 | -C "DHM prime too short:" |
| 5645 | |
| 5646 | run_test "DHM size: server 1024, client default, OK" \ |
| 5647 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5648 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5649 | debug_level=1" \ |
| 5650 | 0 \ |
| 5651 | -C "DHM prime too short:" |
| 5652 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5653 | run_test "DHM size: server 999, client 999, OK" \ |
| 5654 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5655 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5656 | debug_level=1 dhmlen=999" \ |
| 5657 | 0 \ |
| 5658 | -C "DHM prime too short:" |
| 5659 | |
| 5660 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5661 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5662 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5663 | debug_level=1 dhmlen=1000" \ |
| 5664 | 0 \ |
| 5665 | -C "DHM prime too short:" |
| 5666 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5667 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5668 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5669 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5670 | debug_level=1" \ |
| 5671 | 1 \ |
| 5672 | -c "DHM prime too short:" |
| 5673 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5674 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5675 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5676 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5677 | debug_level=1 dhmlen=1001" \ |
| 5678 | 1 \ |
| 5679 | -c "DHM prime too short:" |
| 5680 | |
| 5681 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5682 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5683 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5684 | debug_level=1 dhmlen=1000" \ |
| 5685 | 1 \ |
| 5686 | -c "DHM prime too short:" |
| 5687 | |
| 5688 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5689 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5690 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5691 | debug_level=1 dhmlen=999" \ |
| 5692 | 1 \ |
| 5693 | -c "DHM prime too short:" |
| 5694 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5695 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5696 | "$P_SRV" \ |
| 5697 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5698 | debug_level=1 dhmlen=2049" \ |
| 5699 | 1 \ |
| 5700 | -c "DHM prime too short:" |
| 5701 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5702 | # Tests for PSK callback |
| 5703 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5704 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5705 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5706 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5707 | psk_identity=foo psk=abc123" \ |
| 5708 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5709 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5710 | -S "SSL - Unknown identity received" \ |
| 5711 | -S "SSL - Verification of the message MAC failed" |
| 5712 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5713 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5714 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5715 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5716 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5717 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5718 | 0 \ |
| 5719 | -c "skip PMS generation for opaque PSK"\ |
| 5720 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5721 | -C "session hash for extended master secret"\ |
| 5722 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5723 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5724 | -S "SSL - Unknown identity received" \ |
| 5725 | -S "SSL - Verification of the message MAC failed" |
| 5726 | |
| 5727 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5728 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5729 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5730 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5731 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5732 | 0 \ |
| 5733 | -c "skip PMS generation for opaque PSK"\ |
| 5734 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5735 | -C "session hash for extended master secret"\ |
| 5736 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5737 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5738 | -S "SSL - Unknown identity received" \ |
| 5739 | -S "SSL - Verification of the message MAC failed" |
| 5740 | |
| 5741 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5742 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5743 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5744 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5745 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5746 | 0 \ |
| 5747 | -c "skip PMS generation for opaque PSK"\ |
| 5748 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5749 | -c "session hash for extended master secret"\ |
| 5750 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5751 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5752 | -S "SSL - Unknown identity received" \ |
| 5753 | -S "SSL - Verification of the message MAC failed" |
| 5754 | |
| 5755 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5756 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5757 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5758 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5759 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5760 | 0 \ |
| 5761 | -c "skip PMS generation for opaque PSK"\ |
| 5762 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5763 | -c "session hash for extended master secret"\ |
| 5764 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5765 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5766 | -S "SSL - Unknown identity received" \ |
| 5767 | -S "SSL - Verification of the message MAC failed" |
| 5768 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5769 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5770 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5771 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 5772 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5773 | psk_identity=foo psk=abc123" \ |
| 5774 | 0 \ |
| 5775 | -C "skip PMS generation for opaque PSK"\ |
| 5776 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5777 | -C "session hash for extended master secret"\ |
| 5778 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5779 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5780 | -S "SSL - Unknown identity received" \ |
| 5781 | -S "SSL - Verification of the message MAC failed" |
| 5782 | |
| 5783 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5784 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5785 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
| 5786 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5787 | psk_identity=foo psk=abc123" \ |
| 5788 | 0 \ |
| 5789 | -C "skip PMS generation for opaque PSK"\ |
| 5790 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5791 | -C "session hash for extended master secret"\ |
| 5792 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5793 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5794 | -S "SSL - Unknown identity received" \ |
| 5795 | -S "SSL - Verification of the message MAC failed" |
| 5796 | |
| 5797 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5798 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5799 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5800 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5801 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5802 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5803 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5804 | -c "session hash for extended master secret"\ |
| 5805 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5806 | -C "skip PMS generation for opaque PSK"\ |
| 5807 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5808 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5809 | -S "SSL - Unknown identity received" \ |
| 5810 | -S "SSL - Verification of the message MAC failed" |
| 5811 | |
| 5812 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5813 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5814 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5815 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5816 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5817 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5818 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5819 | -c "session hash for extended master secret"\ |
| 5820 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5821 | -C "skip PMS generation for opaque PSK"\ |
| 5822 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5823 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5824 | -S "SSL - Unknown identity received" \ |
| 5825 | -S "SSL - Verification of the message MAC failed" |
| 5826 | |
| 5827 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5828 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5829 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 5830 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5831 | psk_identity=def psk=beef" \ |
| 5832 | 0 \ |
| 5833 | -C "skip PMS generation for opaque PSK"\ |
| 5834 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5835 | -C "session hash for extended master secret"\ |
| 5836 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5837 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5838 | -S "SSL - Unknown identity received" \ |
| 5839 | -S "SSL - Verification of the message MAC failed" |
| 5840 | |
| 5841 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5842 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5843 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
| 5844 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5845 | psk_identity=def psk=beef" \ |
| 5846 | 0 \ |
| 5847 | -C "skip PMS generation for opaque PSK"\ |
| 5848 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5849 | -C "session hash for extended master secret"\ |
| 5850 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5851 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5852 | -S "SSL - Unknown identity received" \ |
| 5853 | -S "SSL - Verification of the message MAC failed" |
| 5854 | |
| 5855 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5856 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5857 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5858 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5859 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5860 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5861 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5862 | -c "session hash for extended master secret"\ |
| 5863 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5864 | -C "skip PMS generation for opaque PSK"\ |
| 5865 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5866 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5867 | -S "SSL - Unknown identity received" \ |
| 5868 | -S "SSL - Verification of the message MAC failed" |
| 5869 | |
| 5870 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5871 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5872 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5873 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5874 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5875 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5876 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5877 | -c "session hash for extended master secret"\ |
| 5878 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5879 | -C "skip PMS generation for opaque PSK"\ |
| 5880 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5881 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5882 | -S "SSL - Unknown identity received" \ |
| 5883 | -S "SSL - Verification of the message MAC failed" |
| 5884 | |
| 5885 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5886 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5887 | "$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=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 5888 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5889 | psk_identity=def psk=beef" \ |
| 5890 | 0 \ |
| 5891 | -C "skip PMS generation for opaque PSK"\ |
| 5892 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5893 | -C "session hash for extended master secret"\ |
| 5894 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5895 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5896 | -S "SSL - Unknown identity received" \ |
| 5897 | -S "SSL - Verification of the message MAC failed" |
| 5898 | |
| 5899 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5900 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5901 | "$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=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 5902 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5903 | psk_identity=def psk=beef" \ |
| 5904 | 0 \ |
| 5905 | -C "skip PMS generation for opaque PSK"\ |
| 5906 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5907 | -C "session hash for extended master secret"\ |
| 5908 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5909 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5910 | -S "SSL - Unknown identity received" \ |
| 5911 | -S "SSL - Verification of the message MAC failed" |
| 5912 | |
| 5913 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5914 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5915 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 5916 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5917 | psk_identity=def psk=beef" \ |
| 5918 | 0 \ |
| 5919 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5920 | -C "session hash for extended master secret"\ |
| 5921 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5922 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5923 | -S "SSL - Unknown identity received" \ |
| 5924 | -S "SSL - Verification of the message MAC failed" |
| 5925 | |
| 5926 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5927 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5928 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 5929 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5930 | psk_identity=def psk=beef" \ |
| 5931 | 0 \ |
| 5932 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5933 | -C "session hash for extended master secret"\ |
| 5934 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5935 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5936 | -S "SSL - Unknown identity received" \ |
| 5937 | -S "SSL - Verification of the message MAC failed" |
| 5938 | |
| 5939 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5940 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5941 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=beef debug_level=3 psk_list=abc,dead,def,abc123 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 5942 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5943 | psk_identity=def psk=beef" \ |
| 5944 | 1 \ |
| 5945 | -s "SSL - Verification of the message MAC failed" |
| 5946 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5947 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5948 | "$P_SRV" \ |
| 5949 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5950 | psk_identity=foo psk=abc123" \ |
| 5951 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5952 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5953 | -S "SSL - Unknown identity received" \ |
| 5954 | -S "SSL - Verification of the message MAC failed" |
| 5955 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5956 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5957 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5958 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5959 | psk_identity=foo psk=abc123" \ |
| 5960 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5961 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5962 | -s "SSL - Unknown identity received" \ |
| 5963 | -S "SSL - Verification of the message MAC failed" |
| 5964 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5965 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5966 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5967 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5968 | psk_identity=abc psk=dead" \ |
| 5969 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5970 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5971 | -S "SSL - Unknown identity received" \ |
| 5972 | -S "SSL - Verification of the message MAC failed" |
| 5973 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5974 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5975 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5976 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5977 | psk_identity=def psk=beef" \ |
| 5978 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5979 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5980 | -S "SSL - Unknown identity received" \ |
| 5981 | -S "SSL - Verification of the message MAC failed" |
| 5982 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5983 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5984 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5985 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5986 | psk_identity=ghi psk=beef" \ |
| 5987 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5988 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5989 | -s "SSL - Unknown identity received" \ |
| 5990 | -S "SSL - Verification of the message MAC failed" |
| 5991 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5992 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5993 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5994 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5995 | psk_identity=abc psk=beef" \ |
| 5996 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5997 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5998 | -S "SSL - Unknown identity received" \ |
| 5999 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6000 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6001 | # Tests for EC J-PAKE |
| 6002 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6003 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6004 | run_test "ECJPAKE: client not configured" \ |
| 6005 | "$P_SRV debug_level=3" \ |
| 6006 | "$P_CLI debug_level=3" \ |
| 6007 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6008 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6009 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6010 | -S "found ecjpake kkpp extension" \ |
| 6011 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6012 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6013 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6014 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6015 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6016 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6017 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6018 | run_test "ECJPAKE: server not configured" \ |
| 6019 | "$P_SRV debug_level=3" \ |
| 6020 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6021 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6022 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6023 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6024 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6025 | -s "found ecjpake kkpp extension" \ |
| 6026 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6027 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6028 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6029 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6030 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6031 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6032 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6033 | run_test "ECJPAKE: working, TLS" \ |
| 6034 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6035 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6036 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6037 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6038 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6039 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6040 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6041 | -s "found ecjpake kkpp extension" \ |
| 6042 | -S "skip ecjpake kkpp extension" \ |
| 6043 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6044 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6045 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 6046 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6047 | -S "SSL - Verification of the message MAC failed" |
| 6048 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6049 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6050 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6051 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6052 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6053 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6054 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6055 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6056 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6057 | -s "SSL - Verification of the message MAC failed" |
| 6058 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6059 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6060 | run_test "ECJPAKE: working, DTLS" \ |
| 6061 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6062 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6063 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6064 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6065 | -c "re-using cached ecjpake parameters" \ |
| 6066 | -S "SSL - Verification of the message MAC failed" |
| 6067 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6068 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6069 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6070 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6071 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6072 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6073 | 0 \ |
| 6074 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6075 | -S "SSL - Verification of the message MAC failed" |
| 6076 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6077 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6078 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6079 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6080 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6081 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6082 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6083 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6084 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6085 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6086 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6087 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6088 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6089 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6090 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6091 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6092 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6093 | 0 |
| 6094 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6095 | # Test for ClientHello without extensions |
| 6096 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6097 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6098 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6099 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6100 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6101 | 0 \ |
| 6102 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6103 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6104 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6105 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6106 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6107 | "$P_SRV" \ |
| 6108 | "$P_CLI request_size=100" \ |
| 6109 | 0 \ |
| 6110 | -s "Read from client: 100 bytes read$" |
| 6111 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6112 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6113 | "$P_SRV" \ |
| 6114 | "$P_CLI request_size=500" \ |
| 6115 | 0 \ |
| 6116 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6117 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6118 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6119 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6120 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6121 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6122 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6123 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6124 | 0 \ |
| 6125 | -s "Read from client: 1 bytes read" |
| 6126 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6127 | 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] | 6128 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6129 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6130 | 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] | 6131 | 0 \ |
| 6132 | -s "Read from client: 1 bytes read" |
| 6133 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6134 | 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] | 6135 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6136 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6137 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6138 | 0 \ |
| 6139 | -s "Read from client: 1 bytes read" |
| 6140 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6141 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6142 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6143 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6144 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6145 | 0 \ |
| 6146 | -s "Read from client: 1 bytes read" |
| 6147 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6148 | 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] | 6149 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6150 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6151 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6152 | 0 \ |
| 6153 | -s "Read from client: 1 bytes read" |
| 6154 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6155 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6156 | |
| 6157 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6158 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6159 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6160 | "$P_CLI dtls=1 request_size=1 \ |
| 6161 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6162 | 0 \ |
| 6163 | -s "Read from client: 1 bytes read" |
| 6164 | |
| 6165 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6166 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6167 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6168 | "$P_CLI dtls=1 request_size=1 \ |
| 6169 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6170 | 0 \ |
| 6171 | -s "Read from client: 1 bytes read" |
| 6172 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6173 | # Tests for small server packets |
| 6174 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6175 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6176 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6177 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6178 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6179 | 0 \ |
| 6180 | -c "Read from server: 1 bytes read" |
| 6181 | |
| 6182 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6183 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6184 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6185 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6186 | 0 \ |
| 6187 | -c "Read from server: 1 bytes read" |
| 6188 | |
| 6189 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6190 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6191 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6192 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6193 | 0 \ |
| 6194 | -c "Read from server: 1 bytes read" |
| 6195 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6196 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6197 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6198 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6199 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6200 | 0 \ |
| 6201 | -c "Read from server: 1 bytes read" |
| 6202 | |
| 6203 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6204 | "$P_SRV response_size=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6205 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6206 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6207 | 0 \ |
| 6208 | -c "Read from server: 1 bytes read" |
| 6209 | |
| 6210 | # Tests for small server packets in DTLS |
| 6211 | |
| 6212 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6213 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6214 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6215 | "$P_CLI dtls=1 \ |
| 6216 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6217 | 0 \ |
| 6218 | -c "Read from server: 1 bytes read" |
| 6219 | |
| 6220 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6221 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6222 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6223 | "$P_CLI dtls=1 \ |
| 6224 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6225 | 0 \ |
| 6226 | -c "Read from server: 1 bytes read" |
| 6227 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6228 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6229 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6230 | # How many fragments do we expect to write $1 bytes? |
| 6231 | fragments_for_write() { |
| 6232 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6233 | } |
| 6234 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6235 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6236 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6237 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6238 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6239 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6240 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6241 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6242 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6243 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6244 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6245 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6246 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6247 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6248 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6249 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6250 | 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] | 6251 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6252 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6253 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6254 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6255 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6256 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6257 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6258 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6259 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6260 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6261 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6262 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6263 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6264 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6265 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6266 | 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] | 6267 | "$P_SRV" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6268 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6269 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6270 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6271 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6272 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6273 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6274 | # 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] | 6275 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6276 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6277 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6278 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6279 | 0 \ |
| 6280 | -c "Read from server: 16384 bytes read" |
| 6281 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6282 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6283 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6284 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6285 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6286 | 0 \ |
| 6287 | -s "16384 bytes written in 1 fragments" \ |
| 6288 | -c "Read from server: 16384 bytes read" |
| 6289 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6290 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6291 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6292 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6293 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6294 | 0 \ |
| 6295 | -c "Read from server: 16384 bytes read" |
| 6296 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6297 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6298 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6299 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6300 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6301 | 0 \ |
| 6302 | -s "16384 bytes written in 1 fragments" \ |
| 6303 | -c "Read from server: 16384 bytes read" |
| 6304 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6305 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6306 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6307 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6308 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6309 | 0 \ |
| 6310 | -c "Read from server: 16384 bytes read" |
| 6311 | |
| 6312 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6313 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6314 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6315 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6316 | 0 \ |
| 6317 | -c "Read from server: 16384 bytes read" |
| 6318 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6319 | # Tests for restartable ECC |
| 6320 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6321 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 6322 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6323 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6324 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6325 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6326 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6327 | "$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] | 6328 | 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] | 6329 | debug_level=1" \ |
| 6330 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6331 | -C "x509_verify_cert.*4b00" \ |
| 6332 | -C "mbedtls_pk_verify.*4b00" \ |
| 6333 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6334 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6335 | |
| 6336 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6337 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6338 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6339 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6340 | "$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] | 6341 | 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] | 6342 | debug_level=1 ec_max_ops=0" \ |
| 6343 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6344 | -C "x509_verify_cert.*4b00" \ |
| 6345 | -C "mbedtls_pk_verify.*4b00" \ |
| 6346 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6347 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6348 | |
| 6349 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6350 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6351 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6352 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6353 | "$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] | 6354 | 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] | 6355 | debug_level=1 ec_max_ops=65535" \ |
| 6356 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6357 | -C "x509_verify_cert.*4b00" \ |
| 6358 | -C "mbedtls_pk_verify.*4b00" \ |
| 6359 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6360 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6361 | |
| 6362 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6363 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6364 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6365 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6366 | "$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] | 6367 | 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] | 6368 | debug_level=1 ec_max_ops=1000" \ |
| 6369 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6370 | -c "x509_verify_cert.*4b00" \ |
| 6371 | -c "mbedtls_pk_verify.*4b00" \ |
| 6372 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6373 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6374 | |
| 6375 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6376 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6377 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6378 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6379 | crt_file=data_files/server5-badsign.crt \ |
| 6380 | key_file=data_files/server5.key" \ |
| 6381 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6382 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6383 | debug_level=1 ec_max_ops=1000" \ |
| 6384 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6385 | -c "x509_verify_cert.*4b00" \ |
| 6386 | -C "mbedtls_pk_verify.*4b00" \ |
| 6387 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6388 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6389 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6390 | -c "! mbedtls_ssl_handshake returned" \ |
| 6391 | -c "X509 - Certificate verification failed" |
| 6392 | |
| 6393 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6394 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6395 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6396 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6397 | crt_file=data_files/server5-badsign.crt \ |
| 6398 | key_file=data_files/server5.key" \ |
| 6399 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6400 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6401 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6402 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6403 | -c "x509_verify_cert.*4b00" \ |
| 6404 | -c "mbedtls_pk_verify.*4b00" \ |
| 6405 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6406 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6407 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6408 | -C "! mbedtls_ssl_handshake returned" \ |
| 6409 | -C "X509 - Certificate verification failed" |
| 6410 | |
| 6411 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6412 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6413 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6414 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6415 | crt_file=data_files/server5-badsign.crt \ |
| 6416 | key_file=data_files/server5.key" \ |
| 6417 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6418 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6419 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6420 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6421 | -C "x509_verify_cert.*4b00" \ |
| 6422 | -c "mbedtls_pk_verify.*4b00" \ |
| 6423 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6424 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6425 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6426 | -C "! mbedtls_ssl_handshake returned" \ |
| 6427 | -C "X509 - Certificate verification failed" |
| 6428 | |
| 6429 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6430 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6431 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6432 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6433 | "$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] | 6434 | 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] | 6435 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6436 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6437 | -c "x509_verify_cert.*4b00" \ |
| 6438 | -c "mbedtls_pk_verify.*4b00" \ |
| 6439 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6440 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6441 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6442 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6443 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6444 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6445 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6446 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6447 | debug_level=1 ec_max_ops=1000" \ |
| 6448 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6449 | -c "x509_verify_cert.*4b00" \ |
| 6450 | -c "mbedtls_pk_verify.*4b00" \ |
| 6451 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6452 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6453 | |
| 6454 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6455 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6456 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6457 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6458 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6459 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6460 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6461 | -C "x509_verify_cert.*4b00" \ |
| 6462 | -C "mbedtls_pk_verify.*4b00" \ |
| 6463 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6464 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6465 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6466 | # Tests of asynchronous private key support in SSL |
| 6467 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6468 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6469 | run_test "SSL async private: sign, delay=0" \ |
| 6470 | "$P_SRV \ |
| 6471 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6472 | "$P_CLI" \ |
| 6473 | 0 \ |
| 6474 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6475 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6476 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6477 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6478 | run_test "SSL async private: sign, delay=1" \ |
| 6479 | "$P_SRV \ |
| 6480 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6481 | "$P_CLI" \ |
| 6482 | 0 \ |
| 6483 | -s "Async sign callback: using key slot " \ |
| 6484 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6485 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6486 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6487 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6488 | run_test "SSL async private: sign, delay=2" \ |
| 6489 | "$P_SRV \ |
| 6490 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6491 | "$P_CLI" \ |
| 6492 | 0 \ |
| 6493 | -s "Async sign callback: using key slot " \ |
| 6494 | -U "Async sign callback: using key slot " \ |
| 6495 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6496 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6497 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6498 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6499 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6500 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6501 | run_test "SSL async private: sign, SNI" \ |
| 6502 | "$P_SRV debug_level=3 \ |
| 6503 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6504 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6505 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6506 | "$P_CLI server_name=polarssl.example" \ |
| 6507 | 0 \ |
| 6508 | -s "Async sign callback: using key slot " \ |
| 6509 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6510 | -s "parse ServerName extension" \ |
| 6511 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6512 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6513 | |
| 6514 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6515 | run_test "SSL async private: decrypt, delay=0" \ |
| 6516 | "$P_SRV \ |
| 6517 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6518 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6519 | 0 \ |
| 6520 | -s "Async decrypt callback: using key slot " \ |
| 6521 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6522 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6523 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6524 | run_test "SSL async private: decrypt, delay=1" \ |
| 6525 | "$P_SRV \ |
| 6526 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6527 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6528 | 0 \ |
| 6529 | -s "Async decrypt callback: using key slot " \ |
| 6530 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6531 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6532 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6533 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6534 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6535 | "$P_SRV psk=abc123 \ |
| 6536 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6537 | "$P_CLI psk=abc123 \ |
| 6538 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6539 | 0 \ |
| 6540 | -s "Async decrypt callback: using key slot " \ |
| 6541 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6542 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6543 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6544 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6545 | "$P_SRV psk=abc123 \ |
| 6546 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6547 | "$P_CLI psk=abc123 \ |
| 6548 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6549 | 0 \ |
| 6550 | -s "Async decrypt callback: using key slot " \ |
| 6551 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6552 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6553 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6554 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6555 | run_test "SSL async private: sign callback not present" \ |
| 6556 | "$P_SRV \ |
| 6557 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6558 | "$P_CLI; [ \$? -eq 1 ] && |
| 6559 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6560 | 0 \ |
| 6561 | -S "Async sign callback" \ |
| 6562 | -s "! mbedtls_ssl_handshake returned" \ |
| 6563 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6564 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6565 | -s "Successful connection" |
| 6566 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6567 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6568 | run_test "SSL async private: decrypt callback not present" \ |
| 6569 | "$P_SRV debug_level=1 \ |
| 6570 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6571 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6572 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6573 | 0 \ |
| 6574 | -S "Async decrypt callback" \ |
| 6575 | -s "! mbedtls_ssl_handshake returned" \ |
| 6576 | -s "got no RSA private key" \ |
| 6577 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6578 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6579 | |
| 6580 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6581 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6582 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6583 | "$P_SRV \ |
| 6584 | async_operations=s async_private_delay1=1 \ |
| 6585 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6586 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6587 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6588 | 0 \ |
| 6589 | -s "Async sign callback: using key slot 0," \ |
| 6590 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6591 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6592 | |
| 6593 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6594 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6595 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6596 | "$P_SRV \ |
| 6597 | async_operations=s async_private_delay2=1 \ |
| 6598 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6599 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6600 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6601 | 0 \ |
| 6602 | -s "Async sign callback: using key slot 0," \ |
| 6603 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6604 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6605 | |
| 6606 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6607 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6608 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6609 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6610 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6611 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6612 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6613 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6614 | 0 \ |
| 6615 | -s "Async sign callback: using key slot 1," \ |
| 6616 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6617 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6618 | |
| 6619 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6620 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6621 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6622 | "$P_SRV \ |
| 6623 | async_operations=s async_private_delay1=1 \ |
| 6624 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6625 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6626 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6627 | 0 \ |
| 6628 | -s "Async sign callback: no key matches this certificate." |
| 6629 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6630 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6631 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6632 | "$P_SRV \ |
| 6633 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6634 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6635 | "$P_CLI" \ |
| 6636 | 1 \ |
| 6637 | -s "Async sign callback: injected error" \ |
| 6638 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6639 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6640 | -s "! mbedtls_ssl_handshake returned" |
| 6641 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6642 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6643 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6644 | "$P_SRV \ |
| 6645 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6646 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6647 | "$P_CLI" \ |
| 6648 | 1 \ |
| 6649 | -s "Async sign callback: using key slot " \ |
| 6650 | -S "Async resume" \ |
| 6651 | -s "Async cancel" |
| 6652 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6653 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6654 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6655 | "$P_SRV \ |
| 6656 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6657 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6658 | "$P_CLI" \ |
| 6659 | 1 \ |
| 6660 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6661 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6662 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6663 | -s "! mbedtls_ssl_handshake returned" |
| 6664 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6665 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6666 | run_test "SSL async private: decrypt, error in start" \ |
| 6667 | "$P_SRV \ |
| 6668 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6669 | async_private_error=1" \ |
| 6670 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6671 | 1 \ |
| 6672 | -s "Async decrypt callback: injected error" \ |
| 6673 | -S "Async resume" \ |
| 6674 | -S "Async cancel" \ |
| 6675 | -s "! mbedtls_ssl_handshake returned" |
| 6676 | |
| 6677 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6678 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6679 | "$P_SRV \ |
| 6680 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6681 | async_private_error=2" \ |
| 6682 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6683 | 1 \ |
| 6684 | -s "Async decrypt callback: using key slot " \ |
| 6685 | -S "Async resume" \ |
| 6686 | -s "Async cancel" |
| 6687 | |
| 6688 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6689 | run_test "SSL async private: decrypt, error in resume" \ |
| 6690 | "$P_SRV \ |
| 6691 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6692 | async_private_error=3" \ |
| 6693 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6694 | 1 \ |
| 6695 | -s "Async decrypt callback: using key slot " \ |
| 6696 | -s "Async resume callback: decrypt done but injected error" \ |
| 6697 | -S "Async cancel" \ |
| 6698 | -s "! mbedtls_ssl_handshake returned" |
| 6699 | |
| 6700 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6701 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6702 | "$P_SRV \ |
| 6703 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6704 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6705 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6706 | 0 \ |
| 6707 | -s "Async cancel" \ |
| 6708 | -s "! mbedtls_ssl_handshake returned" \ |
| 6709 | -s "Async resume" \ |
| 6710 | -s "Successful connection" |
| 6711 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6712 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6713 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6714 | "$P_SRV \ |
| 6715 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6716 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6717 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6718 | 0 \ |
| 6719 | -s "! mbedtls_ssl_handshake returned" \ |
| 6720 | -s "Async resume" \ |
| 6721 | -s "Successful connection" |
| 6722 | |
| 6723 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6724 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6725 | 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] | 6726 | "$P_SRV \ |
| 6727 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6728 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6729 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6730 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6731 | [ \$? -eq 1 ] && |
| 6732 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6733 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6734 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6735 | -S "Async resume" \ |
| 6736 | -s "Async cancel" \ |
| 6737 | -s "! mbedtls_ssl_handshake returned" \ |
| 6738 | -s "Async sign callback: no key matches this certificate." \ |
| 6739 | -s "Successful connection" |
| 6740 | |
| 6741 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6742 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6743 | 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] | 6744 | "$P_SRV \ |
| 6745 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6746 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6747 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6748 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6749 | [ \$? -eq 1 ] && |
| 6750 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6751 | 0 \ |
| 6752 | -s "Async resume" \ |
| 6753 | -s "! mbedtls_ssl_handshake returned" \ |
| 6754 | -s "Async sign callback: no key matches this certificate." \ |
| 6755 | -s "Successful connection" |
| 6756 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6757 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6758 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6759 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6760 | "$P_SRV \ |
| 6761 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6762 | exchanges=2 renegotiation=1" \ |
| 6763 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6764 | 0 \ |
| 6765 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6766 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6767 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6768 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6770 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6771 | "$P_SRV \ |
| 6772 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6773 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6774 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6775 | 0 \ |
| 6776 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6777 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6778 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6779 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6780 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6781 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6782 | "$P_SRV \ |
| 6783 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6784 | exchanges=2 renegotiation=1" \ |
| 6785 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6786 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6787 | 0 \ |
| 6788 | -s "Async decrypt callback: using key slot " \ |
| 6789 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6790 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6791 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6792 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6793 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6794 | "$P_SRV \ |
| 6795 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6796 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6797 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6798 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6799 | 0 \ |
| 6800 | -s "Async decrypt callback: using key slot " \ |
| 6801 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6802 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6803 | # Tests for ECC extensions (rfc 4492) |
| 6804 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6805 | requires_config_enabled MBEDTLS_AES_C |
| 6806 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6807 | requires_config_enabled MBEDTLS_SHA256_C |
| 6808 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6809 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6810 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6811 | "$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] | 6812 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 6813 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6814 | -C "client hello, adding supported_point_formats extension" \ |
| 6815 | -S "found supported elliptic curves extension" \ |
| 6816 | -S "found supported point formats extension" |
| 6817 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6818 | requires_config_enabled MBEDTLS_AES_C |
| 6819 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6820 | requires_config_enabled MBEDTLS_SHA256_C |
| 6821 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6822 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6823 | "$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] | 6824 | "$P_CLI debug_level=3" \ |
| 6825 | 0 \ |
| 6826 | -C "found supported_point_formats extension" \ |
| 6827 | -S "server hello, supported_point_formats extension" |
| 6828 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6829 | requires_config_enabled MBEDTLS_AES_C |
| 6830 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6831 | requires_config_enabled MBEDTLS_SHA256_C |
| 6832 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6833 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6834 | "$P_SRV debug_level=3" \ |
| 6835 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6836 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 6837 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6838 | -c "client hello, adding supported_point_formats extension" \ |
| 6839 | -s "found supported elliptic curves extension" \ |
| 6840 | -s "found supported point formats extension" |
| 6841 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6842 | requires_config_enabled MBEDTLS_AES_C |
| 6843 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6844 | requires_config_enabled MBEDTLS_SHA256_C |
| 6845 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6846 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6847 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6848 | "$P_CLI debug_level=3" \ |
| 6849 | 0 \ |
| 6850 | -c "found supported_point_formats extension" \ |
| 6851 | -s "server hello, supported_point_formats extension" |
| 6852 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6853 | # Tests for DTLS HelloVerifyRequest |
| 6854 | |
| 6855 | run_test "DTLS cookie: enabled" \ |
| 6856 | "$P_SRV dtls=1 debug_level=2" \ |
| 6857 | "$P_CLI dtls=1 debug_level=2" \ |
| 6858 | 0 \ |
| 6859 | -s "cookie verification failed" \ |
| 6860 | -s "cookie verification passed" \ |
| 6861 | -S "cookie verification skipped" \ |
| 6862 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6863 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6864 | -S "SSL - The requested feature is not available" |
| 6865 | |
| 6866 | run_test "DTLS cookie: disabled" \ |
| 6867 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6868 | "$P_CLI dtls=1 debug_level=2" \ |
| 6869 | 0 \ |
| 6870 | -S "cookie verification failed" \ |
| 6871 | -S "cookie verification passed" \ |
| 6872 | -s "cookie verification skipped" \ |
| 6873 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6874 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6875 | -S "SSL - The requested feature is not available" |
| 6876 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6877 | run_test "DTLS cookie: default (failing)" \ |
| 6878 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6879 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6880 | 1 \ |
| 6881 | -s "cookie verification failed" \ |
| 6882 | -S "cookie verification passed" \ |
| 6883 | -S "cookie verification skipped" \ |
| 6884 | -C "received hello verify request" \ |
| 6885 | -S "hello verification requested" \ |
| 6886 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6887 | |
| 6888 | requires_ipv6 |
| 6889 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6890 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6891 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6892 | 0 \ |
| 6893 | -s "cookie verification failed" \ |
| 6894 | -s "cookie verification passed" \ |
| 6895 | -S "cookie verification skipped" \ |
| 6896 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6897 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6898 | -S "SSL - The requested feature is not available" |
| 6899 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6900 | run_test "DTLS cookie: enabled, nbio" \ |
| 6901 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6902 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6903 | 0 \ |
| 6904 | -s "cookie verification failed" \ |
| 6905 | -s "cookie verification passed" \ |
| 6906 | -S "cookie verification skipped" \ |
| 6907 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6908 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6909 | -S "SSL - The requested feature is not available" |
| 6910 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6911 | # Tests for client reconnecting from the same port with DTLS |
| 6912 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6913 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6914 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6915 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6916 | "$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] | 6917 | 0 \ |
| 6918 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6919 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6920 | -S "Client initiated reconnection from same port" |
| 6921 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6922 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6923 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6924 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6925 | "$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] | 6926 | 0 \ |
| 6927 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6928 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6929 | -s "Client initiated reconnection from same port" |
| 6930 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6931 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6932 | 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] | 6933 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6934 | "$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] | 6935 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6936 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6937 | -s "Client initiated reconnection from same port" |
| 6938 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6939 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6940 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6941 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6942 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6943 | 0 \ |
| 6944 | -S "The operation timed out" \ |
| 6945 | -s "Client initiated reconnection from same port" |
| 6946 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6947 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6948 | "$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] | 6949 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6950 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6951 | -s "The operation timed out" \ |
| 6952 | -S "Client initiated reconnection from same port" |
| 6953 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6954 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6955 | -p "$P_PXY inject_clihlo=1" \ |
| 6956 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6957 | "$P_CLI dtls=1 exchanges=2" \ |
| 6958 | 0 \ |
| 6959 | -s "possible client reconnect from the same port" \ |
| 6960 | -S "Client initiated reconnection from same port" |
| 6961 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6962 | # Tests for various cases of client authentication with DTLS |
| 6963 | # (focused on handshake flows and message parsing) |
| 6964 | |
| 6965 | run_test "DTLS client auth: required" \ |
| 6966 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6967 | "$P_CLI dtls=1" \ |
| 6968 | 0 \ |
| 6969 | -s "Verifying peer X.509 certificate... ok" |
| 6970 | |
| 6971 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6972 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6973 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6974 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6975 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6976 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6977 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6978 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6979 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6980 | 0 \ |
| 6981 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6982 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6983 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6984 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6985 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6986 | "$P_CLI dtls=1 psk=abc124" \ |
| 6987 | 1 \ |
| 6988 | -s "SSL - Verification of the message MAC failed" \ |
| 6989 | -c "SSL - A fatal alert message was received from our peer" |
| 6990 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6991 | # Tests for receiving fragmented handshake messages with DTLS |
| 6992 | |
| 6993 | requires_gnutls |
| 6994 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6995 | "$G_SRV -u --mtu 2048 -a" \ |
| 6996 | "$P_CLI dtls=1 debug_level=2" \ |
| 6997 | 0 \ |
| 6998 | -C "found fragmented DTLS handshake message" \ |
| 6999 | -C "error" |
| 7000 | |
| 7001 | requires_gnutls |
| 7002 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7003 | "$G_SRV -u --mtu 512" \ |
| 7004 | "$P_CLI dtls=1 debug_level=2" \ |
| 7005 | 0 \ |
| 7006 | -c "found fragmented DTLS handshake message" \ |
| 7007 | -C "error" |
| 7008 | |
| 7009 | requires_gnutls |
| 7010 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7011 | "$G_SRV -u --mtu 128" \ |
| 7012 | "$P_CLI dtls=1 debug_level=2" \ |
| 7013 | 0 \ |
| 7014 | -c "found fragmented DTLS handshake message" \ |
| 7015 | -C "error" |
| 7016 | |
| 7017 | requires_gnutls |
| 7018 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7019 | "$G_SRV -u --mtu 128" \ |
| 7020 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7021 | 0 \ |
| 7022 | -c "found fragmented DTLS handshake message" \ |
| 7023 | -C "error" |
| 7024 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7025 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7026 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7027 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7028 | "$G_SRV -u --mtu 256" \ |
| 7029 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7030 | 0 \ |
| 7031 | -c "found fragmented DTLS handshake message" \ |
| 7032 | -c "client hello, adding renegotiation extension" \ |
| 7033 | -c "found renegotiation extension" \ |
| 7034 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7035 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7036 | -C "error" \ |
| 7037 | -s "Extra-header:" |
| 7038 | |
| 7039 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7040 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7041 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7042 | "$G_SRV -u --mtu 256" \ |
| 7043 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7044 | 0 \ |
| 7045 | -c "found fragmented DTLS handshake message" \ |
| 7046 | -c "client hello, adding renegotiation extension" \ |
| 7047 | -c "found renegotiation extension" \ |
| 7048 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7049 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7050 | -C "error" \ |
| 7051 | -s "Extra-header:" |
| 7052 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7053 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7054 | "$O_SRV -dtls -mtu 2048" \ |
| 7055 | "$P_CLI dtls=1 debug_level=2" \ |
| 7056 | 0 \ |
| 7057 | -C "found fragmented DTLS handshake message" \ |
| 7058 | -C "error" |
| 7059 | |
| 7060 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7061 | "$O_SRV -dtls -mtu 768" \ |
| 7062 | "$P_CLI dtls=1 debug_level=2" \ |
| 7063 | 0 \ |
| 7064 | -c "found fragmented DTLS handshake message" \ |
| 7065 | -C "error" |
| 7066 | |
| 7067 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 7068 | "$O_SRV -dtls -mtu 256" \ |
| 7069 | "$P_CLI dtls=1 debug_level=2" \ |
| 7070 | 0 \ |
| 7071 | -c "found fragmented DTLS handshake message" \ |
| 7072 | -C "error" |
| 7073 | |
| 7074 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7075 | "$O_SRV -dtls -mtu 256" \ |
| 7076 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7077 | 0 \ |
| 7078 | -c "found fragmented DTLS handshake message" \ |
| 7079 | -C "error" |
| 7080 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7081 | # Tests for sending fragmented handshake messages with DTLS |
| 7082 | # |
| 7083 | # Use client auth when we need the client to send large messages, |
| 7084 | # and use large cert chains on both sides too (the long chains we have all use |
| 7085 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7086 | # Sizes reached (UDP payload): |
| 7087 | # - 2037B for server certificate |
| 7088 | # - 1542B for client certificate |
| 7089 | # - 1013B for newsessionticket |
| 7090 | # - all others below 512B |
| 7091 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7092 | |
| 7093 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7094 | requires_config_enabled MBEDTLS_RSA_C |
| 7095 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7096 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7097 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7098 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7099 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7100 | crt_file=data_files/server7_int-ca.crt \ |
| 7101 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7102 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7103 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7104 | "$P_CLI dtls=1 debug_level=2 \ |
| 7105 | crt_file=data_files/server8_int-ca2.crt \ |
| 7106 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7107 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7108 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7109 | 0 \ |
| 7110 | -S "found fragmented DTLS handshake message" \ |
| 7111 | -C "found fragmented DTLS handshake message" \ |
| 7112 | -C "error" |
| 7113 | |
| 7114 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7115 | requires_config_enabled MBEDTLS_RSA_C |
| 7116 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7117 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7118 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7119 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7120 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7121 | crt_file=data_files/server7_int-ca.crt \ |
| 7122 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7123 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7124 | max_frag_len=1024" \ |
| 7125 | "$P_CLI dtls=1 debug_level=2 \ |
| 7126 | crt_file=data_files/server8_int-ca2.crt \ |
| 7127 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7128 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7129 | max_frag_len=2048" \ |
| 7130 | 0 \ |
| 7131 | -S "found fragmented DTLS handshake message" \ |
| 7132 | -c "found fragmented DTLS handshake message" \ |
| 7133 | -C "error" |
| 7134 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7135 | # With the MFL extension, the server has no way of forcing |
| 7136 | # the client to not exceed a certain MTU; hence, the following |
| 7137 | # test can't be replicated with an MTU proxy such as the one |
| 7138 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7139 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7140 | requires_config_enabled MBEDTLS_RSA_C |
| 7141 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7142 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7143 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7144 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7145 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7146 | crt_file=data_files/server7_int-ca.crt \ |
| 7147 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7148 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7149 | max_frag_len=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 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7153 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7154 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7155 | 0 \ |
| 7156 | -S "found fragmented DTLS handshake message" \ |
| 7157 | -c "found fragmented DTLS handshake message" \ |
| 7158 | -C "error" |
| 7159 | |
| 7160 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7161 | requires_config_enabled MBEDTLS_RSA_C |
| 7162 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7163 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7164 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7165 | 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] | 7166 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7167 | crt_file=data_files/server7_int-ca.crt \ |
| 7168 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7169 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7170 | max_frag_len=2048" \ |
| 7171 | "$P_CLI dtls=1 debug_level=2 \ |
| 7172 | crt_file=data_files/server8_int-ca2.crt \ |
| 7173 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7174 | hs_timeout=2500-60000 \ |
| 7175 | max_frag_len=1024" \ |
| 7176 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7177 | -S "found fragmented DTLS handshake message" \ |
| 7178 | -c "found fragmented DTLS handshake message" \ |
| 7179 | -C "error" |
| 7180 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7181 | # While not required by the standard defining the MFL extension |
| 7182 | # (according to which it only applies to records, not to datagrams), |
| 7183 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7184 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7185 | # to the peer. |
| 7186 | # The next test checks that no datagrams significantly larger than the |
| 7187 | # negotiated MFL are sent. |
| 7188 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7189 | requires_config_enabled MBEDTLS_RSA_C |
| 7190 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7191 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7192 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7193 | 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] | 7194 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7195 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7196 | crt_file=data_files/server7_int-ca.crt \ |
| 7197 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7198 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7199 | max_frag_len=2048" \ |
| 7200 | "$P_CLI dtls=1 debug_level=2 \ |
| 7201 | crt_file=data_files/server8_int-ca2.crt \ |
| 7202 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7203 | hs_timeout=2500-60000 \ |
| 7204 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7205 | 0 \ |
| 7206 | -S "found fragmented DTLS handshake message" \ |
| 7207 | -c "found fragmented DTLS handshake message" \ |
| 7208 | -C "error" |
| 7209 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7210 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7211 | requires_config_enabled MBEDTLS_RSA_C |
| 7212 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7213 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7214 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7215 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7216 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7217 | crt_file=data_files/server7_int-ca.crt \ |
| 7218 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7219 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7220 | max_frag_len=2048" \ |
| 7221 | "$P_CLI dtls=1 debug_level=2 \ |
| 7222 | crt_file=data_files/server8_int-ca2.crt \ |
| 7223 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7224 | hs_timeout=2500-60000 \ |
| 7225 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7226 | 0 \ |
| 7227 | -s "found fragmented DTLS handshake message" \ |
| 7228 | -c "found fragmented DTLS handshake message" \ |
| 7229 | -C "error" |
| 7230 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7231 | # While not required by the standard defining the MFL extension |
| 7232 | # (according to which it only applies to records, not to datagrams), |
| 7233 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7234 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7235 | # to the peer. |
| 7236 | # The next test checks that no datagrams significantly larger than the |
| 7237 | # negotiated MFL are sent. |
| 7238 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7239 | requires_config_enabled MBEDTLS_RSA_C |
| 7240 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7241 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7242 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7243 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7244 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7245 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7246 | crt_file=data_files/server7_int-ca.crt \ |
| 7247 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7248 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7249 | max_frag_len=2048" \ |
| 7250 | "$P_CLI dtls=1 debug_level=2 \ |
| 7251 | crt_file=data_files/server8_int-ca2.crt \ |
| 7252 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7253 | hs_timeout=2500-60000 \ |
| 7254 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7255 | 0 \ |
| 7256 | -s "found fragmented DTLS handshake message" \ |
| 7257 | -c "found fragmented DTLS handshake message" \ |
| 7258 | -C "error" |
| 7259 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7260 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7261 | requires_config_enabled MBEDTLS_RSA_C |
| 7262 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7263 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7264 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7265 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7266 | crt_file=data_files/server7_int-ca.crt \ |
| 7267 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7268 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7269 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7270 | "$P_CLI dtls=1 debug_level=2 \ |
| 7271 | crt_file=data_files/server8_int-ca2.crt \ |
| 7272 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7273 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7274 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7275 | 0 \ |
| 7276 | -S "found fragmented DTLS handshake message" \ |
| 7277 | -C "found fragmented DTLS handshake message" \ |
| 7278 | -C "error" |
| 7279 | |
| 7280 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7281 | requires_config_enabled MBEDTLS_RSA_C |
| 7282 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7283 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7284 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7285 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7286 | crt_file=data_files/server7_int-ca.crt \ |
| 7287 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7288 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7289 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7290 | "$P_CLI dtls=1 debug_level=2 \ |
| 7291 | crt_file=data_files/server8_int-ca2.crt \ |
| 7292 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7293 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7294 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7295 | 0 \ |
| 7296 | -s "found fragmented DTLS handshake message" \ |
| 7297 | -C "found fragmented DTLS handshake message" \ |
| 7298 | -C "error" |
| 7299 | |
| 7300 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7301 | requires_config_enabled MBEDTLS_RSA_C |
| 7302 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7303 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7304 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7305 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7306 | crt_file=data_files/server7_int-ca.crt \ |
| 7307 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7308 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7309 | mtu=512" \ |
| 7310 | "$P_CLI dtls=1 debug_level=2 \ |
| 7311 | crt_file=data_files/server8_int-ca2.crt \ |
| 7312 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7313 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7314 | mtu=2048" \ |
| 7315 | 0 \ |
| 7316 | -S "found fragmented DTLS handshake message" \ |
| 7317 | -c "found fragmented DTLS handshake message" \ |
| 7318 | -C "error" |
| 7319 | |
| 7320 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7321 | requires_config_enabled MBEDTLS_RSA_C |
| 7322 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7323 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7324 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7325 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7326 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7327 | crt_file=data_files/server7_int-ca.crt \ |
| 7328 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7329 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7330 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7331 | "$P_CLI dtls=1 debug_level=2 \ |
| 7332 | crt_file=data_files/server8_int-ca2.crt \ |
| 7333 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7334 | hs_timeout=2500-60000 \ |
| 7335 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7336 | 0 \ |
| 7337 | -s "found fragmented DTLS handshake message" \ |
| 7338 | -c "found fragmented DTLS handshake message" \ |
| 7339 | -C "error" |
| 7340 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7341 | # 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] | 7342 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7343 | requires_config_enabled MBEDTLS_RSA_C |
| 7344 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7345 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7346 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7347 | requires_config_enabled MBEDTLS_AES_C |
| 7348 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7349 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7350 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7351 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7352 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7353 | crt_file=data_files/server7_int-ca.crt \ |
| 7354 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7355 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7356 | mtu=512" \ |
| 7357 | "$P_CLI dtls=1 debug_level=2 \ |
| 7358 | crt_file=data_files/server8_int-ca2.crt \ |
| 7359 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7360 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7361 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7362 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7363 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7364 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7365 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7366 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7367 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7368 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7369 | # 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] | 7370 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7371 | # retransmissions, but in some cases (like both the server and client using |
| 7372 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7373 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7374 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7375 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7376 | requires_config_enabled MBEDTLS_RSA_C |
| 7377 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7378 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7379 | requires_config_enabled MBEDTLS_AES_C |
| 7380 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7381 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7382 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7383 | -p "$P_PXY mtu=508" \ |
| 7384 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7385 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7386 | key_file=data_files/server7.key \ |
| 7387 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7388 | "$P_CLI dtls=1 debug_level=2 \ |
| 7389 | crt_file=data_files/server8_int-ca2.crt \ |
| 7390 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7391 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7392 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7393 | 0 \ |
| 7394 | -s "found fragmented DTLS handshake message" \ |
| 7395 | -c "found fragmented DTLS handshake message" \ |
| 7396 | -C "error" |
| 7397 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7398 | # 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] | 7399 | only_with_valgrind |
| 7400 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7401 | requires_config_enabled MBEDTLS_RSA_C |
| 7402 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7403 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7404 | requires_config_enabled MBEDTLS_AES_C |
| 7405 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7406 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7407 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7408 | -p "$P_PXY mtu=508" \ |
| 7409 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7410 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7411 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7412 | hs_timeout=250-10000" \ |
| 7413 | "$P_CLI dtls=1 debug_level=2 \ |
| 7414 | crt_file=data_files/server8_int-ca2.crt \ |
| 7415 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7416 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7417 | hs_timeout=250-10000" \ |
| 7418 | 0 \ |
| 7419 | -s "found fragmented DTLS handshake message" \ |
| 7420 | -c "found fragmented DTLS handshake message" \ |
| 7421 | -C "error" |
| 7422 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7423 | # 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] | 7424 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7425 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7426 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7427 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7428 | requires_config_enabled MBEDTLS_RSA_C |
| 7429 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7430 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7431 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7432 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7433 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7434 | crt_file=data_files/server7_int-ca.crt \ |
| 7435 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7436 | hs_timeout=10000-60000 \ |
| 7437 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7438 | "$P_CLI dtls=1 debug_level=2 \ |
| 7439 | crt_file=data_files/server8_int-ca2.crt \ |
| 7440 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7441 | hs_timeout=10000-60000 \ |
| 7442 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7443 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7444 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7445 | -s "found fragmented DTLS handshake message" \ |
| 7446 | -c "found fragmented DTLS handshake message" \ |
| 7447 | -C "error" |
| 7448 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7449 | # 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] | 7450 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7451 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7452 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7453 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7454 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7455 | requires_config_enabled MBEDTLS_RSA_C |
| 7456 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7457 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7458 | requires_config_enabled MBEDTLS_AES_C |
| 7459 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7460 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7461 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7462 | -p "$P_PXY mtu=512" \ |
| 7463 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7464 | crt_file=data_files/server7_int-ca.crt \ |
| 7465 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7466 | hs_timeout=10000-60000 \ |
| 7467 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7468 | "$P_CLI dtls=1 debug_level=2 \ |
| 7469 | crt_file=data_files/server8_int-ca2.crt \ |
| 7470 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7471 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7472 | hs_timeout=10000-60000 \ |
| 7473 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7474 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7475 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7476 | -s "found fragmented DTLS handshake message" \ |
| 7477 | -c "found fragmented DTLS handshake message" \ |
| 7478 | -C "error" |
| 7479 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7480 | not_with_valgrind # spurious autoreduction due to timeout |
| 7481 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7482 | requires_config_enabled MBEDTLS_RSA_C |
| 7483 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7484 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7485 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7486 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7487 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7488 | crt_file=data_files/server7_int-ca.crt \ |
| 7489 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7490 | hs_timeout=10000-60000 \ |
| 7491 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7492 | "$P_CLI dtls=1 debug_level=2 \ |
| 7493 | crt_file=data_files/server8_int-ca2.crt \ |
| 7494 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7495 | hs_timeout=10000-60000 \ |
| 7496 | mtu=1024 nbio=2" \ |
| 7497 | 0 \ |
| 7498 | -S "autoreduction" \ |
| 7499 | -s "found fragmented DTLS handshake message" \ |
| 7500 | -c "found fragmented DTLS handshake message" \ |
| 7501 | -C "error" |
| 7502 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7503 | # 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] | 7504 | not_with_valgrind # spurious autoreduction due to timeout |
| 7505 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7506 | requires_config_enabled MBEDTLS_RSA_C |
| 7507 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7508 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7509 | requires_config_enabled MBEDTLS_AES_C |
| 7510 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7511 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7512 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7513 | -p "$P_PXY mtu=512" \ |
| 7514 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7515 | crt_file=data_files/server7_int-ca.crt \ |
| 7516 | key_file=data_files/server7.key \ |
| 7517 | hs_timeout=10000-60000 \ |
| 7518 | mtu=512 nbio=2" \ |
| 7519 | "$P_CLI dtls=1 debug_level=2 \ |
| 7520 | crt_file=data_files/server8_int-ca2.crt \ |
| 7521 | key_file=data_files/server8.key \ |
| 7522 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7523 | hs_timeout=10000-60000 \ |
| 7524 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7525 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7526 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7527 | -s "found fragmented DTLS handshake message" \ |
| 7528 | -c "found fragmented DTLS handshake message" \ |
| 7529 | -C "error" |
| 7530 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7531 | # 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] | 7532 | # This ensures things still work after session_reset(). |
| 7533 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7534 | # Since we don't support reading fragmented ClientHello yet, |
| 7535 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7536 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7537 | # An autoreduction on the client-side might happen if the server is |
| 7538 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7539 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7540 | # resumed listening, which would result in a spurious autoreduction. |
| 7541 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7542 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7543 | requires_config_enabled MBEDTLS_RSA_C |
| 7544 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7545 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7546 | requires_config_enabled MBEDTLS_AES_C |
| 7547 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7548 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7549 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7550 | -p "$P_PXY mtu=1450" \ |
| 7551 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7552 | crt_file=data_files/server7_int-ca.crt \ |
| 7553 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7554 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7555 | mtu=1450" \ |
| 7556 | "$P_CLI dtls=1 debug_level=2 \ |
| 7557 | crt_file=data_files/server8_int-ca2.crt \ |
| 7558 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7559 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7560 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7561 | 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] | 7562 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7563 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7564 | -s "found fragmented DTLS handshake message" \ |
| 7565 | -c "found fragmented DTLS handshake message" \ |
| 7566 | -C "error" |
| 7567 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7568 | # An autoreduction on the client-side might happen if the server is |
| 7569 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7570 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7571 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7572 | requires_config_enabled MBEDTLS_RSA_C |
| 7573 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7574 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7575 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7576 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7577 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7578 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7579 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7580 | -p "$P_PXY mtu=512" \ |
| 7581 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7582 | crt_file=data_files/server7_int-ca.crt \ |
| 7583 | key_file=data_files/server7.key \ |
| 7584 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7585 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7586 | mtu=512" \ |
| 7587 | "$P_CLI dtls=1 debug_level=2 \ |
| 7588 | crt_file=data_files/server8_int-ca2.crt \ |
| 7589 | key_file=data_files/server8.key \ |
| 7590 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7591 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7592 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7593 | mtu=512" \ |
| 7594 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7595 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7596 | -s "found fragmented DTLS handshake message" \ |
| 7597 | -c "found fragmented DTLS handshake message" \ |
| 7598 | -C "error" |
| 7599 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7600 | # An autoreduction on the client-side might happen if the server is |
| 7601 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7602 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7603 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7604 | requires_config_enabled MBEDTLS_RSA_C |
| 7605 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7606 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7607 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7608 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7609 | requires_config_enabled MBEDTLS_AES_C |
| 7610 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7611 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7612 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7613 | -p "$P_PXY mtu=512" \ |
| 7614 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7615 | crt_file=data_files/server7_int-ca.crt \ |
| 7616 | key_file=data_files/server7.key \ |
| 7617 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7618 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7619 | mtu=512" \ |
| 7620 | "$P_CLI dtls=1 debug_level=2 \ |
| 7621 | crt_file=data_files/server8_int-ca2.crt \ |
| 7622 | key_file=data_files/server8.key \ |
| 7623 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7624 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7625 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7626 | mtu=512" \ |
| 7627 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7628 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7629 | -s "found fragmented DTLS handshake message" \ |
| 7630 | -c "found fragmented DTLS handshake message" \ |
| 7631 | -C "error" |
| 7632 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7633 | # An autoreduction on the client-side might happen if the server is |
| 7634 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7635 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7636 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7637 | requires_config_enabled MBEDTLS_RSA_C |
| 7638 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7639 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7640 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7641 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7642 | requires_config_enabled MBEDTLS_AES_C |
| 7643 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7644 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7645 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7646 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7647 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7648 | crt_file=data_files/server7_int-ca.crt \ |
| 7649 | key_file=data_files/server7.key \ |
| 7650 | exchanges=2 renegotiation=1 \ |
| 7651 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7652 | hs_timeout=10000-60000 \ |
| 7653 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7654 | "$P_CLI dtls=1 debug_level=2 \ |
| 7655 | crt_file=data_files/server8_int-ca2.crt \ |
| 7656 | key_file=data_files/server8.key \ |
| 7657 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7658 | hs_timeout=10000-60000 \ |
| 7659 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7660 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7661 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7662 | -s "found fragmented DTLS handshake message" \ |
| 7663 | -c "found fragmented DTLS handshake message" \ |
| 7664 | -C "error" |
| 7665 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7666 | # An autoreduction on the client-side might happen if the server is |
| 7667 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7668 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7669 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7670 | requires_config_enabled MBEDTLS_RSA_C |
| 7671 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7672 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7673 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7674 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7675 | requires_config_enabled MBEDTLS_AES_C |
| 7676 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7677 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7678 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7679 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7680 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7681 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7682 | crt_file=data_files/server7_int-ca.crt \ |
| 7683 | key_file=data_files/server7.key \ |
| 7684 | exchanges=2 renegotiation=1 \ |
| 7685 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7686 | hs_timeout=10000-60000 \ |
| 7687 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7688 | "$P_CLI dtls=1 debug_level=2 \ |
| 7689 | crt_file=data_files/server8_int-ca2.crt \ |
| 7690 | key_file=data_files/server8.key \ |
| 7691 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7692 | hs_timeout=10000-60000 \ |
| 7693 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7694 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7695 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7696 | -s "found fragmented DTLS handshake message" \ |
| 7697 | -c "found fragmented DTLS handshake message" \ |
| 7698 | -C "error" |
| 7699 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7700 | # An autoreduction on the client-side might happen if the server is |
| 7701 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7702 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7703 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7704 | requires_config_enabled MBEDTLS_RSA_C |
| 7705 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7706 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7707 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7708 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7709 | requires_config_enabled MBEDTLS_AES_C |
| 7710 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7711 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7712 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7713 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7714 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7715 | crt_file=data_files/server7_int-ca.crt \ |
| 7716 | key_file=data_files/server7.key \ |
| 7717 | exchanges=2 renegotiation=1 \ |
| 7718 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7719 | hs_timeout=10000-60000 \ |
| 7720 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7721 | "$P_CLI dtls=1 debug_level=2 \ |
| 7722 | crt_file=data_files/server8_int-ca2.crt \ |
| 7723 | key_file=data_files/server8.key \ |
| 7724 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7725 | hs_timeout=10000-60000 \ |
| 7726 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7727 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7728 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7729 | -s "found fragmented DTLS handshake message" \ |
| 7730 | -c "found fragmented DTLS handshake message" \ |
| 7731 | -C "error" |
| 7732 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7733 | # 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] | 7734 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7735 | requires_config_enabled MBEDTLS_RSA_C |
| 7736 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7737 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7738 | requires_config_enabled MBEDTLS_AES_C |
| 7739 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7740 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7741 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7742 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7743 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7744 | "$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] | 7745 | crt_file=data_files/server7_int-ca.crt \ |
| 7746 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7747 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7748 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7749 | crt_file=data_files/server8_int-ca2.crt \ |
| 7750 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7751 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7752 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7753 | 0 \ |
| 7754 | -s "found fragmented DTLS handshake message" \ |
| 7755 | -c "found fragmented DTLS handshake message" \ |
| 7756 | -C "error" |
| 7757 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7758 | # 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] | 7759 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7760 | requires_config_enabled MBEDTLS_RSA_C |
| 7761 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7762 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7763 | requires_config_enabled MBEDTLS_AES_C |
| 7764 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7765 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7766 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7767 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7768 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7769 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7770 | crt_file=data_files/server7_int-ca.crt \ |
| 7771 | key_file=data_files/server7.key \ |
| 7772 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7773 | "$P_CLI dtls=1 debug_level=2 \ |
| 7774 | crt_file=data_files/server8_int-ca2.crt \ |
| 7775 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7776 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7777 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7778 | 0 \ |
| 7779 | -s "found fragmented DTLS handshake message" \ |
| 7780 | -c "found fragmented DTLS handshake message" \ |
| 7781 | -C "error" |
| 7782 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7783 | # interop tests for DTLS fragmentating with reliable connection |
| 7784 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7785 | # here and below we just want to test that the we fragment in a way that |
| 7786 | # pleases other implementations, so we don't need the peer to fragment |
| 7787 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7788 | requires_config_enabled MBEDTLS_RSA_C |
| 7789 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7791 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7792 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7793 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7794 | "$G_SRV -u" \ |
| 7795 | "$P_CLI dtls=1 debug_level=2 \ |
| 7796 | crt_file=data_files/server8_int-ca2.crt \ |
| 7797 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7798 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7799 | 0 \ |
| 7800 | -c "fragmenting handshake message" \ |
| 7801 | -C "error" |
| 7802 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7803 | # We use --insecure for the GnuTLS client because it expects |
| 7804 | # the hostname / IP it connects to to be the name used in the |
| 7805 | # certificate obtained from the server. Here, however, it |
| 7806 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7807 | # as the server name in the certificate. This will make the |
| 7808 | # certifiate validation fail, but passing --insecure makes |
| 7809 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7810 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7811 | requires_config_enabled MBEDTLS_RSA_C |
| 7812 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7814 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7815 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7816 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7817 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7818 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7819 | crt_file=data_files/server7_int-ca.crt \ |
| 7820 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7821 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7822 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7823 | 0 \ |
| 7824 | -s "fragmenting handshake message" |
| 7825 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7826 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7827 | requires_config_enabled MBEDTLS_RSA_C |
| 7828 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7829 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7830 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7831 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7832 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7833 | "$P_CLI dtls=1 debug_level=2 \ |
| 7834 | crt_file=data_files/server8_int-ca2.crt \ |
| 7835 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7836 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7837 | 0 \ |
| 7838 | -c "fragmenting handshake message" \ |
| 7839 | -C "error" |
| 7840 | |
| 7841 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7842 | requires_config_enabled MBEDTLS_RSA_C |
| 7843 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7845 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7846 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7847 | "$P_SRV dtls=1 debug_level=2 \ |
| 7848 | crt_file=data_files/server7_int-ca.crt \ |
| 7849 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7850 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7851 | "$O_CLI -dtls1_2" \ |
| 7852 | 0 \ |
| 7853 | -s "fragmenting handshake message" |
| 7854 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7855 | # interop tests for DTLS fragmentating with unreliable connection |
| 7856 | # |
| 7857 | # again we just want to test that the we fragment in a way that |
| 7858 | # pleases other implementations, so we don't need the peer to fragment |
| 7859 | requires_gnutls_next |
| 7860 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7861 | requires_config_enabled MBEDTLS_RSA_C |
| 7862 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7863 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7864 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7865 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7866 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7867 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7868 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7869 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7870 | crt_file=data_files/server8_int-ca2.crt \ |
| 7871 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7872 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7873 | 0 \ |
| 7874 | -c "fragmenting handshake message" \ |
| 7875 | -C "error" |
| 7876 | |
| 7877 | requires_gnutls_next |
| 7878 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7879 | requires_config_enabled MBEDTLS_RSA_C |
| 7880 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7882 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7883 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7884 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7885 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7886 | "$P_SRV dtls=1 debug_level=2 \ |
| 7887 | crt_file=data_files/server7_int-ca.crt \ |
| 7888 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7889 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7890 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7891 | 0 \ |
| 7892 | -s "fragmenting handshake message" |
| 7893 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7894 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7895 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7896 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7897 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7898 | ## (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] | 7899 | skip_next_test |
| 7900 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7901 | requires_config_enabled MBEDTLS_RSA_C |
| 7902 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7903 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7904 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7905 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7906 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7907 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7908 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7909 | "$P_CLI dtls=1 debug_level=2 \ |
| 7910 | crt_file=data_files/server8_int-ca2.crt \ |
| 7911 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7912 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7913 | 0 \ |
| 7914 | -c "fragmenting handshake message" \ |
| 7915 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7916 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7917 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7918 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7919 | requires_config_enabled MBEDTLS_RSA_C |
| 7920 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7921 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7922 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7923 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7924 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7925 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7926 | "$P_SRV dtls=1 debug_level=2 \ |
| 7927 | crt_file=data_files/server7_int-ca.crt \ |
| 7928 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7929 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7930 | "$O_CLI -dtls1_2" \ |
| 7931 | 0 \ |
| 7932 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7933 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7934 | # Tests for DTLS-SRTP (RFC 5764) |
| 7935 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7936 | run_test "DTLS-SRTP all profiles supported" \ |
| 7937 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7938 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7939 | 0 \ |
| 7940 | -s "found use_srtp extension" \ |
| 7941 | -s "found srtp profile" \ |
| 7942 | -s "selected srtp profile" \ |
| 7943 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7944 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7945 | -c "client hello, adding use_srtp extension" \ |
| 7946 | -c "found use_srtp extension" \ |
| 7947 | -c "found srtp profile" \ |
| 7948 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7949 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7950 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7951 | -C "error" |
| 7952 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7953 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7954 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7955 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7956 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7957 | "$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] | 7958 | 0 \ |
| 7959 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7960 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7961 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7962 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7963 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7964 | -c "client hello, adding use_srtp extension" \ |
| 7965 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7966 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7967 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7968 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7969 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7970 | -C "error" |
| 7971 | |
| 7972 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7973 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7974 | "$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] | 7975 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7976 | 0 \ |
| 7977 | -s "found use_srtp extension" \ |
| 7978 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7979 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7980 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7981 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7982 | -c "client hello, adding use_srtp extension" \ |
| 7983 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7984 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7985 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7986 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7987 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7988 | -C "error" |
| 7989 | |
| 7990 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7991 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7992 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7993 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7994 | 0 \ |
| 7995 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7996 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7997 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7998 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7999 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8000 | -c "client hello, adding use_srtp extension" \ |
| 8001 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8002 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8003 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8004 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8005 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8006 | -C "error" |
| 8007 | |
| 8008 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8009 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 8010 | "$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] | 8011 | "$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] | 8012 | 0 \ |
| 8013 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8014 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8015 | -S "selected srtp profile" \ |
| 8016 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8017 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8018 | -c "client hello, adding use_srtp extension" \ |
| 8019 | -C "found use_srtp extension" \ |
| 8020 | -C "found srtp profile" \ |
| 8021 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8022 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8023 | -C "error" |
| 8024 | |
| 8025 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8026 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 8027 | "$P_SRV dtls=1 debug_level=3" \ |
| 8028 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8029 | 0 \ |
| 8030 | -s "found use_srtp extension" \ |
| 8031 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8032 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8033 | -c "client hello, adding use_srtp extension" \ |
| 8034 | -C "found use_srtp extension" \ |
| 8035 | -C "found srtp profile" \ |
| 8036 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8037 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8038 | -C "error" |
| 8039 | |
| 8040 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8041 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 8042 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 8043 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8044 | 0 \ |
| 8045 | -s "found use_srtp extension" \ |
| 8046 | -s "found srtp profile" \ |
| 8047 | -s "selected srtp profile" \ |
| 8048 | -s "server hello, adding use_srtp extension" \ |
| 8049 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8050 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8051 | -c "client hello, adding use_srtp extension" \ |
| 8052 | -c "found use_srtp extension" \ |
| 8053 | -c "found srtp profile" \ |
| 8054 | -c "selected srtp profile" \ |
| 8055 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8056 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8057 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8058 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8059 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8060 | -C "error" |
| 8061 | |
| 8062 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8063 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 8064 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8065 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8066 | 0 \ |
| 8067 | -s "found use_srtp extension" \ |
| 8068 | -s "found srtp profile" \ |
| 8069 | -s "selected srtp profile" \ |
| 8070 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8071 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8072 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8073 | -S "dumping 'using mki' (8 bytes)" \ |
| 8074 | -c "client hello, adding use_srtp extension" \ |
| 8075 | -c "found use_srtp extension" \ |
| 8076 | -c "found srtp profile" \ |
| 8077 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8078 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8079 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8080 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8081 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8082 | -C "dumping 'received mki' (8 bytes)" \ |
| 8083 | -C "error" |
| 8084 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8085 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 8086 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 8087 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8088 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8089 | 0 \ |
| 8090 | -s "found use_srtp extension" \ |
| 8091 | -s "found srtp profile" \ |
| 8092 | -s "selected srtp profile" \ |
| 8093 | -s "server hello, adding use_srtp extension" \ |
| 8094 | -s "DTLS-SRTP key material is"\ |
| 8095 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8096 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 8097 | |
| 8098 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8099 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 8100 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8101 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8102 | 0 \ |
| 8103 | -s "found use_srtp extension" \ |
| 8104 | -s "found srtp profile" \ |
| 8105 | -s "selected srtp profile" \ |
| 8106 | -s "server hello, adding use_srtp extension" \ |
| 8107 | -s "DTLS-SRTP key material is"\ |
| 8108 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8109 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8110 | |
| 8111 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8112 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 8113 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8114 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8115 | 0 \ |
| 8116 | -s "found use_srtp extension" \ |
| 8117 | -s "found srtp profile" \ |
| 8118 | -s "selected srtp profile" \ |
| 8119 | -s "server hello, adding use_srtp extension" \ |
| 8120 | -s "DTLS-SRTP key material is"\ |
| 8121 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8122 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8123 | |
| 8124 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8125 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 8126 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8127 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8128 | 0 \ |
| 8129 | -s "found use_srtp extension" \ |
| 8130 | -s "found srtp profile" \ |
| 8131 | -s "selected srtp profile" \ |
| 8132 | -s "server hello, adding use_srtp extension" \ |
| 8133 | -s "DTLS-SRTP key material is"\ |
| 8134 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8135 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8136 | |
| 8137 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8138 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 8139 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8140 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8141 | 0 \ |
| 8142 | -s "found use_srtp extension" \ |
| 8143 | -s "found srtp profile" \ |
| 8144 | -s "selected srtp profile" \ |
| 8145 | -s "server hello, adding use_srtp extension" \ |
| 8146 | -s "DTLS-SRTP key material is"\ |
| 8147 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 8148 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8149 | |
| 8150 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8151 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 8152 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8153 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8154 | 0 \ |
| 8155 | -s "found use_srtp extension" \ |
| 8156 | -s "found srtp profile" \ |
| 8157 | -S "selected srtp profile" \ |
| 8158 | -S "server hello, adding use_srtp extension" \ |
| 8159 | -S "DTLS-SRTP key material is"\ |
| 8160 | -C "SRTP Extension negotiated, profile" |
| 8161 | |
| 8162 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8163 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 8164 | "$P_SRV dtls=1 debug_level=3" \ |
| 8165 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8166 | 0 \ |
| 8167 | -s "found use_srtp extension" \ |
| 8168 | -S "server hello, adding use_srtp extension" \ |
| 8169 | -S "DTLS-SRTP key material is"\ |
| 8170 | -C "SRTP Extension negotiated, profile" |
| 8171 | |
| 8172 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8173 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 8174 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8175 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8176 | 0 \ |
| 8177 | -c "client hello, adding use_srtp extension" \ |
| 8178 | -c "found use_srtp extension" \ |
| 8179 | -c "found srtp profile" \ |
| 8180 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 8181 | -c "DTLS-SRTP key material is"\ |
| 8182 | -C "error" |
| 8183 | |
| 8184 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8185 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 8186 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8187 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8188 | 0 \ |
| 8189 | -c "client hello, adding use_srtp extension" \ |
| 8190 | -c "found use_srtp extension" \ |
| 8191 | -c "found srtp profile" \ |
| 8192 | -c "selected srtp profile" \ |
| 8193 | -c "DTLS-SRTP key material is"\ |
| 8194 | -C "error" |
| 8195 | |
| 8196 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8197 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 8198 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8199 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8200 | 0 \ |
| 8201 | -c "client hello, adding use_srtp extension" \ |
| 8202 | -c "found use_srtp extension" \ |
| 8203 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8204 | -c "selected srtp profile" \ |
| 8205 | -c "DTLS-SRTP key material is"\ |
| 8206 | -C "error" |
| 8207 | |
| 8208 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8209 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 8210 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8211 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8212 | 0 \ |
| 8213 | -c "client hello, adding use_srtp extension" \ |
| 8214 | -c "found use_srtp extension" \ |
| 8215 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8216 | -c "selected srtp profile" \ |
| 8217 | -c "DTLS-SRTP key material is"\ |
| 8218 | -C "error" |
| 8219 | |
| 8220 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8221 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 8222 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8223 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8224 | 0 \ |
| 8225 | -c "client hello, adding use_srtp extension" \ |
| 8226 | -c "found use_srtp extension" \ |
| 8227 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8228 | -c "selected srtp profile" \ |
| 8229 | -c "DTLS-SRTP key material is"\ |
| 8230 | -C "error" |
| 8231 | |
| 8232 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8233 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 8234 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8235 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 8236 | 0 \ |
| 8237 | -c "client hello, adding use_srtp extension" \ |
| 8238 | -C "found use_srtp extension" \ |
| 8239 | -C "found srtp profile" \ |
| 8240 | -C "selected srtp profile" \ |
| 8241 | -C "DTLS-SRTP key material is"\ |
| 8242 | -C "error" |
| 8243 | |
| 8244 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8245 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 8246 | "$O_SRV -dtls" \ |
| 8247 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8248 | 0 \ |
| 8249 | -c "client hello, adding use_srtp extension" \ |
| 8250 | -C "found use_srtp extension" \ |
| 8251 | -C "found srtp profile" \ |
| 8252 | -C "selected srtp profile" \ |
| 8253 | -C "DTLS-SRTP key material is"\ |
| 8254 | -C "error" |
| 8255 | |
| 8256 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8257 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 8258 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 8259 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8260 | 0 \ |
| 8261 | -c "client hello, adding use_srtp extension" \ |
| 8262 | -c "found use_srtp extension" \ |
| 8263 | -c "found srtp profile" \ |
| 8264 | -c "selected srtp profile" \ |
| 8265 | -c "DTLS-SRTP key material is"\ |
| 8266 | -c "DTLS-SRTP no mki value negotiated"\ |
| 8267 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8268 | -C "dumping 'received mki' (8 bytes)" \ |
| 8269 | -C "error" |
| 8270 | |
| 8271 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8272 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8273 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8274 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8275 | "$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] | 8276 | 0 \ |
| 8277 | -s "found use_srtp extension" \ |
| 8278 | -s "found srtp profile" \ |
| 8279 | -s "selected srtp profile" \ |
| 8280 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8281 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8282 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8283 | |
| 8284 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8285 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8286 | 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] | 8287 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8288 | "$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] | 8289 | 0 \ |
| 8290 | -s "found use_srtp extension" \ |
| 8291 | -s "found srtp profile" \ |
| 8292 | -s "selected srtp profile" \ |
| 8293 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8294 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8295 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8296 | |
| 8297 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8298 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8299 | 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] | 8300 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8301 | "$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] | 8302 | 0 \ |
| 8303 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8304 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8305 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8306 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8307 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8308 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8309 | |
| 8310 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8311 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8312 | 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] | 8313 | "$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] | 8314 | "$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] | 8315 | 0 \ |
| 8316 | -s "found use_srtp extension" \ |
| 8317 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8318 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8319 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8320 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8321 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8322 | |
| 8323 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8324 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8325 | 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] | 8326 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8327 | "$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] | 8328 | 0 \ |
| 8329 | -s "found use_srtp extension" \ |
| 8330 | -s "found srtp profile" \ |
| 8331 | -s "selected srtp profile" \ |
| 8332 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8333 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8334 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8335 | |
| 8336 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8337 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8338 | 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] | 8339 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8340 | "$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] | 8341 | 0 \ |
| 8342 | -s "found use_srtp extension" \ |
| 8343 | -s "found srtp profile" \ |
| 8344 | -S "selected srtp profile" \ |
| 8345 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8346 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8347 | -C "SRTP profile:" |
| 8348 | |
| 8349 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8350 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8351 | 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] | 8352 | "$P_SRV dtls=1 debug_level=3" \ |
| 8353 | "$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] | 8354 | 0 \ |
| 8355 | -s "found use_srtp extension" \ |
| 8356 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8357 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8358 | -C "SRTP profile:" |
| 8359 | |
| 8360 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8361 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8362 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8363 | "$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" \ |
| 8364 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8365 | 0 \ |
| 8366 | -c "client hello, adding use_srtp extension" \ |
| 8367 | -c "found use_srtp extension" \ |
| 8368 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8369 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8370 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8371 | -C "error" |
| 8372 | |
| 8373 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8374 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8375 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8376 | "$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" \ |
| 8377 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8378 | 0 \ |
| 8379 | -c "client hello, adding use_srtp extension" \ |
| 8380 | -c "found use_srtp extension" \ |
| 8381 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8382 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8383 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8384 | -C "error" |
| 8385 | |
| 8386 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8387 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8388 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8389 | "$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" \ |
| 8390 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8391 | 0 \ |
| 8392 | -c "client hello, adding use_srtp extension" \ |
| 8393 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8394 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8395 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8396 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8397 | -C "error" |
| 8398 | |
| 8399 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8400 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8401 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8402 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8403 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8404 | 0 \ |
| 8405 | -c "client hello, adding use_srtp extension" \ |
| 8406 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8407 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8408 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8409 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8410 | -C "error" |
| 8411 | |
| 8412 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8413 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8414 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8415 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8416 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8417 | 0 \ |
| 8418 | -c "client hello, adding use_srtp extension" \ |
| 8419 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8420 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8421 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8422 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8423 | -C "error" |
| 8424 | |
| 8425 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8426 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8427 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8428 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8429 | "$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] | 8430 | 0 \ |
| 8431 | -c "client hello, adding use_srtp extension" \ |
| 8432 | -C "found use_srtp extension" \ |
| 8433 | -C "found srtp profile" \ |
| 8434 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8435 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8436 | -C "error" |
| 8437 | |
| 8438 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8439 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8440 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8441 | "$G_SRV -u" \ |
| 8442 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8443 | 0 \ |
| 8444 | -c "client hello, adding use_srtp extension" \ |
| 8445 | -C "found use_srtp extension" \ |
| 8446 | -C "found srtp profile" \ |
| 8447 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8448 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8449 | -C "error" |
| 8450 | |
| 8451 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8452 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8453 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8454 | "$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" \ |
| 8455 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8456 | 0 \ |
| 8457 | -c "client hello, adding use_srtp extension" \ |
| 8458 | -c "found use_srtp extension" \ |
| 8459 | -c "found srtp profile" \ |
| 8460 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8461 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8462 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8463 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8464 | -c "dumping 'received mki' (8 bytes)" \ |
| 8465 | -C "error" |
| 8466 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8467 | # Tests for specific things with "unreliable" UDP connection |
| 8468 | |
| 8469 | not_with_valgrind # spurious resend due to timeout |
| 8470 | run_test "DTLS proxy: reference" \ |
| 8471 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8472 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8473 | "$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] | 8474 | 0 \ |
| 8475 | -C "replayed record" \ |
| 8476 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8477 | -C "Buffer record from epoch" \ |
| 8478 | -S "Buffer record from epoch" \ |
| 8479 | -C "ssl_buffer_message" \ |
| 8480 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8481 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8482 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8483 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8484 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8485 | -c "HTTP/1.0 200 OK" |
| 8486 | |
| 8487 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8488 | run_test "DTLS proxy: duplicate every packet" \ |
| 8489 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8490 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8491 | "$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] | 8492 | 0 \ |
| 8493 | -c "replayed record" \ |
| 8494 | -s "replayed record" \ |
| 8495 | -c "record from another epoch" \ |
| 8496 | -s "record from another epoch" \ |
| 8497 | -S "resend" \ |
| 8498 | -s "Extra-header:" \ |
| 8499 | -c "HTTP/1.0 200 OK" |
| 8500 | |
| 8501 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8502 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8503 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8504 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8505 | 0 \ |
| 8506 | -c "replayed record" \ |
| 8507 | -S "replayed record" \ |
| 8508 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8509 | -s "record from another epoch" \ |
| 8510 | -c "resend" \ |
| 8511 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8512 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8513 | -c "HTTP/1.0 200 OK" |
| 8514 | |
| 8515 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8516 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8517 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8518 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8519 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8520 | -c "next record in same datagram" \ |
| 8521 | -s "next record in same datagram" |
| 8522 | |
| 8523 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8524 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8525 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8526 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8527 | 0 \ |
| 8528 | -c "next record in same datagram" \ |
| 8529 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8530 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8531 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8532 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8533 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8534 | "$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] | 8535 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8536 | -c "discarding invalid record (mac)" \ |
| 8537 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8538 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8539 | -c "HTTP/1.0 200 OK" \ |
| 8540 | -S "too many records with bad MAC" \ |
| 8541 | -S "Verification of the message MAC failed" |
| 8542 | |
| 8543 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8544 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8545 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8546 | "$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] | 8547 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8548 | -C "discarding invalid record (mac)" \ |
| 8549 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8550 | -S "Extra-header:" \ |
| 8551 | -C "HTTP/1.0 200 OK" \ |
| 8552 | -s "too many records with bad MAC" \ |
| 8553 | -s "Verification of the message MAC failed" |
| 8554 | |
| 8555 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8556 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8557 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8558 | "$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] | 8559 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8560 | -c "discarding invalid record (mac)" \ |
| 8561 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8562 | -s "Extra-header:" \ |
| 8563 | -c "HTTP/1.0 200 OK" \ |
| 8564 | -S "too many records with bad MAC" \ |
| 8565 | -S "Verification of the message MAC failed" |
| 8566 | |
| 8567 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8568 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8569 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8570 | "$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] | 8571 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8572 | -c "discarding invalid record (mac)" \ |
| 8573 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8574 | -s "Extra-header:" \ |
| 8575 | -c "HTTP/1.0 200 OK" \ |
| 8576 | -s "too many records with bad MAC" \ |
| 8577 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8578 | |
| 8579 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8580 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8581 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8582 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8583 | 0 \ |
| 8584 | -c "record from another epoch" \ |
| 8585 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8586 | -s "Extra-header:" \ |
| 8587 | -c "HTTP/1.0 200 OK" |
| 8588 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8589 | # Tests for reordering support with DTLS |
| 8590 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8591 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8592 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8593 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8594 | hs_timeout=2500-60000" \ |
| 8595 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8596 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8597 | 0 \ |
| 8598 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8599 | -c "Next handshake message has been buffered - load"\ |
| 8600 | -S "Buffering HS message" \ |
| 8601 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8602 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8603 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8604 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8605 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8606 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8607 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8608 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8609 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8610 | hs_timeout=2500-60000" \ |
| 8611 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8612 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8613 | 0 \ |
| 8614 | -c "Buffering HS message" \ |
| 8615 | -c "found fragmented DTLS handshake message"\ |
| 8616 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8617 | -c "Next handshake message has been buffered - load"\ |
| 8618 | -S "Buffering HS message" \ |
| 8619 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8620 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8621 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8622 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8623 | -S "Remember CCS message" |
| 8624 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8625 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8626 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8627 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8628 | # while keeping the ServerKeyExchange. |
| 8629 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8630 | 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] | 8631 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8632 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8633 | hs_timeout=2500-60000" \ |
| 8634 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8635 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8636 | 0 \ |
| 8637 | -c "Buffering HS message" \ |
| 8638 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8639 | -C "attempt to make space by freeing buffered messages" \ |
| 8640 | -S "Buffering HS message" \ |
| 8641 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8642 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8643 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8644 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8645 | -S "Remember CCS message" |
| 8646 | |
| 8647 | # The size constraints ensure that the delayed certificate message can't |
| 8648 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8649 | # when dropping it first. |
| 8650 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8651 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8652 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8653 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8654 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8655 | hs_timeout=2500-60000" \ |
| 8656 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8657 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8658 | 0 \ |
| 8659 | -c "Buffering HS message" \ |
| 8660 | -c "attempt to make space by freeing buffered future messages" \ |
| 8661 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8662 | -S "Buffering HS message" \ |
| 8663 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8664 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8665 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8666 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8667 | -S "Remember CCS message" |
| 8668 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8669 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8670 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8671 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8672 | hs_timeout=2500-60000" \ |
| 8673 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8674 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8675 | 0 \ |
| 8676 | -C "Buffering HS message" \ |
| 8677 | -C "Next handshake message has been buffered - load"\ |
| 8678 | -s "Buffering HS message" \ |
| 8679 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8680 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8681 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8682 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8683 | -S "Remember CCS message" |
| 8684 | |
| 8685 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8686 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8687 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8688 | hs_timeout=2500-60000" \ |
| 8689 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8690 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8691 | 0 \ |
| 8692 | -C "Buffering HS message" \ |
| 8693 | -C "Next handshake message has been buffered - load"\ |
| 8694 | -S "Buffering HS message" \ |
| 8695 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8696 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8697 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8698 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8699 | -S "Remember CCS message" |
| 8700 | |
| 8701 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8702 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8703 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8704 | hs_timeout=2500-60000" \ |
| 8705 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8706 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8707 | 0 \ |
| 8708 | -C "Buffering HS message" \ |
| 8709 | -C "Next handshake message has been buffered - load"\ |
| 8710 | -S "Buffering HS message" \ |
| 8711 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8712 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8713 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8714 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8715 | -s "Remember CCS message" |
| 8716 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8717 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8718 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8719 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8720 | hs_timeout=2500-60000" \ |
| 8721 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8722 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8723 | 0 \ |
| 8724 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8725 | -s "Found buffered record from current epoch - load" \ |
| 8726 | -c "Buffer record from epoch 1" \ |
| 8727 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8728 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8729 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8730 | # from the server are delayed, so that the encrypted Finished message |
| 8731 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8732 | # in afterwards, the encrypted Finished message must be freed in order |
| 8733 | # to make space for the NewSessionTicket to be reassembled. |
| 8734 | # This works only in very particular circumstances: |
| 8735 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8736 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8737 | # the encrypted Finished message. |
| 8738 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8739 | # needs to be fragmented. |
| 8740 | # - All messages sent by the server must be small enough to be either sent |
| 8741 | # without fragmentation or be reassembled within the bounds of |
| 8742 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8743 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8744 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8745 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8746 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8747 | -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] | 8748 | "$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] | 8749 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8750 | 0 \ |
| 8751 | -s "Buffer record from epoch 1" \ |
| 8752 | -s "Found buffered record from current epoch - load" \ |
| 8753 | -c "Buffer record from epoch 1" \ |
| 8754 | -C "Found buffered record from current epoch - load" \ |
| 8755 | -c "Enough space available after freeing future epoch record" |
| 8756 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8757 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8758 | |
| 8759 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8760 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8761 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8762 | "$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] | 8763 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8764 | "$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] | 8765 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8766 | 0 \ |
| 8767 | -s "Extra-header:" \ |
| 8768 | -c "HTTP/1.0 200 OK" |
| 8769 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8770 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8771 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8772 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8773 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8774 | "$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] | 8775 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8776 | 0 \ |
| 8777 | -s "Extra-header:" \ |
| 8778 | -c "HTTP/1.0 200 OK" |
| 8779 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8780 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8781 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8782 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8783 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8784 | "$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] | 8785 | 0 \ |
| 8786 | -s "Extra-header:" \ |
| 8787 | -c "HTTP/1.0 200 OK" |
| 8788 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8789 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8790 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8791 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8792 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8793 | "$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] | 8794 | 0 \ |
| 8795 | -s "Extra-header:" \ |
| 8796 | -c "HTTP/1.0 200 OK" |
| 8797 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8798 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8799 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8800 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8801 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8802 | "$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] | 8803 | 0 \ |
| 8804 | -s "Extra-header:" \ |
| 8805 | -c "HTTP/1.0 200 OK" |
| 8806 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8807 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8808 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8809 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8810 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8811 | "$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] | 8812 | 0 \ |
| 8813 | -s "Extra-header:" \ |
| 8814 | -c "HTTP/1.0 200 OK" |
| 8815 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8816 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8817 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8818 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8819 | "$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] | 8820 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8821 | "$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] | 8822 | 0 \ |
| 8823 | -s "Extra-header:" \ |
| 8824 | -c "HTTP/1.0 200 OK" |
| 8825 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8826 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8827 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8828 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8829 | "$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] | 8830 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8831 | "$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] | 8832 | 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] | 8833 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8834 | 0 \ |
| 8835 | -s "a session has been resumed" \ |
| 8836 | -c "a session has been resumed" \ |
| 8837 | -s "Extra-header:" \ |
| 8838 | -c "HTTP/1.0 200 OK" |
| 8839 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8840 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8841 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8842 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8843 | "$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] | 8844 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8845 | "$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] | 8846 | 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] | 8847 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8848 | 0 \ |
| 8849 | -s "a session has been resumed" \ |
| 8850 | -c "a session has been resumed" \ |
| 8851 | -s "Extra-header:" \ |
| 8852 | -c "HTTP/1.0 200 OK" |
| 8853 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8854 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8855 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8856 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8857 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8858 | "$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] | 8859 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8860 | "$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] | 8861 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8862 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8863 | 0 \ |
| 8864 | -c "=> renegotiate" \ |
| 8865 | -s "=> renegotiate" \ |
| 8866 | -s "Extra-header:" \ |
| 8867 | -c "HTTP/1.0 200 OK" |
| 8868 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8869 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8870 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8871 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8872 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8873 | "$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] | 8874 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8875 | "$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] | 8876 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8877 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8878 | 0 \ |
| 8879 | -c "=> renegotiate" \ |
| 8880 | -s "=> renegotiate" \ |
| 8881 | -s "Extra-header:" \ |
| 8882 | -c "HTTP/1.0 200 OK" |
| 8883 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8884 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8885 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8886 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8887 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8888 | "$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] | 8889 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8890 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8891 | "$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] | 8892 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8893 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8894 | 0 \ |
| 8895 | -c "=> renegotiate" \ |
| 8896 | -s "=> renegotiate" \ |
| 8897 | -s "Extra-header:" \ |
| 8898 | -c "HTTP/1.0 200 OK" |
| 8899 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8900 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8901 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8902 | 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] | 8903 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8904 | "$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] | 8905 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8906 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8907 | "$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] | 8908 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8909 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8910 | 0 \ |
| 8911 | -c "=> renegotiate" \ |
| 8912 | -s "=> renegotiate" \ |
| 8913 | -s "Extra-header:" \ |
| 8914 | -c "HTTP/1.0 200 OK" |
| 8915 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8916 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8917 | ## all versions installed on the CI machines), reported here: |
| 8918 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8919 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8920 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8921 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8922 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8923 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8924 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8925 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8926 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8927 | "$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] | 8928 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8929 | -c "HTTP/1.0 200 OK" |
| 8930 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8931 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8932 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8933 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8934 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8935 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8936 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8937 | "$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] | 8938 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8939 | -c "HTTP/1.0 200 OK" |
| 8940 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8941 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8942 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8943 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8944 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8945 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8946 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8947 | "$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] | 8948 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8949 | -c "HTTP/1.0 200 OK" |
| 8950 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8951 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8952 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8953 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8954 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8955 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8956 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8957 | "$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] | 8958 | 0 \ |
| 8959 | -s "Extra-header:" \ |
| 8960 | -c "Extra-header:" |
| 8961 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8962 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8963 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8964 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8965 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8966 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8967 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8968 | "$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] | 8969 | 0 \ |
| 8970 | -s "Extra-header:" \ |
| 8971 | -c "Extra-header:" |
| 8972 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8973 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8974 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8975 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8976 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8977 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8978 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8979 | "$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] | 8980 | 0 \ |
| 8981 | -s "Extra-header:" \ |
| 8982 | -c "Extra-header:" |
| 8983 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8984 | run_test "export keys functionality" \ |
| 8985 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8986 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8987 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8988 | -c "EAP-TLS key material is:"\ |
| 8989 | -s "EAP-TLS key material is:"\ |
| 8990 | -c "EAP-TLS IV is:" \ |
| 8991 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8992 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8993 | # openssl feature tests: check if tls1.3 exists. |
| 8994 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 8995 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8996 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 8997 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 8998 | 0 \ |
| 8999 | -c "TLS 1.3" \ |
| 9000 | -s "TLS 1.3" |
| 9001 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 9002 | # gnutls feature tests: check if TLS 1.3 is supported as well as the NO_TICKETS and DISABLE_TLS13_COMPAT_MODE options. |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9003 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 9004 | requires_gnutls_next_no_ticket |
| 9005 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9006 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9007 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert " \ |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 9008 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 9009 | 0 \ |
| 9010 | -s "Version: TLS1.3" \ |
| 9011 | -c "Version: TLS1.3" |
| 9012 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9013 | # TLS1.3 test cases |
| 9014 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 9015 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9017 | skip_handshake_stage_check |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9018 | run_test "TLS 1.3: Not supported version check: tls12 and tls13" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9019 | "$P_SRV debug_level=1 min_version=tls12 max_version=tls13" \ |
| 9020 | "$P_CLI debug_level=1 min_version=tls12 max_version=tls13" \ |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 9021 | 1 \ |
| 9022 | -s "SSL - The requested feature is not available" \ |
| 9023 | -c "SSL - The requested feature is not available" \ |
| 9024 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 9025 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 9026 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9029 | run_test "TLS 1.3: handshake dispatch test: tls13 only" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9030 | "$P_SRV debug_level=2 min_version=tls13 max_version=tls13" \ |
| 9031 | "$P_CLI debug_level=2 min_version=tls13 max_version=tls13" \ |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9032 | 1 \ |
Jerry Yu | e3b3412 | 2021-09-28 17:53:35 +0800 | [diff] [blame] | 9033 | -s "tls13 server state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 9034 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 9035 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9036 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9038 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9039 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9040 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 42920ec | 2021-09-28 14:31:15 +0800 | [diff] [blame] | 9041 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9042 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9043 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9044 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9045 | 0 \ |
Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 9046 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)" \ |
| 9047 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)" \ |
| 9048 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)" \ |
| 9049 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)" \ |
| 9050 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)" \ |
| 9051 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)" \ |
| 9052 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)" \ |
| 9053 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)" \ |
| 9054 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)" \ |
| 9055 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9056 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9057 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 9058 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9059 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 9060 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9061 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 9062 | -c "=> parse certificate verify" \ |
| 9063 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9064 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9065 | -c "<= parse finished message" \ |
| 9066 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 9067 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 9068 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 9069 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9070 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9071 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9072 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9073 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 42920ec | 2021-09-28 14:31:15 +0800 | [diff] [blame] | 9074 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9075 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9076 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Xiaofei Bai | d25fab6 | 2021-12-02 06:36:27 +0000 | [diff] [blame] | 9077 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 9078 | 0 \ |
Jerry Yu | cdcc55f | 2021-11-11 13:26:33 +0800 | [diff] [blame] | 9079 | -s "SERVER HELLO was queued" \ |
| 9080 | -c "tls13 client state: MBEDTLS_SSL_HELLO_REQUEST(0)" \ |
| 9081 | -c "tls13 client state: MBEDTLS_SSL_SERVER_HELLO(2)" \ |
| 9082 | -c "tls13 client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS(19)" \ |
| 9083 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_REQUEST(5)" \ |
| 9084 | -c "tls13 client state: MBEDTLS_SSL_SERVER_CERTIFICATE(3)" \ |
| 9085 | -c "tls13 client state: MBEDTLS_SSL_CERTIFICATE_VERIFY(9)" \ |
| 9086 | -c "tls13 client state: MBEDTLS_SSL_SERVER_FINISHED(13)" \ |
| 9087 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_FINISHED(11)" \ |
| 9088 | -c "tls13 client state: MBEDTLS_SSL_FLUSH_BUFFERS(14)" \ |
| 9089 | -c "tls13 client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP(15)" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9090 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 9091 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 9092 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 9093 | -c "=> ssl_tls13_process_server_hello" \ |
Jerry Yu | daac359 | 2021-10-29 20:01:42 +0800 | [diff] [blame] | 9094 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 9095 | -c "Certificate verification flags clear" \ |
Jerry Yu | 5398c10 | 2021-11-05 13:32:38 +0800 | [diff] [blame] | 9096 | -c "=> parse certificate verify" \ |
| 9097 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9098 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 9099 | -c "<= parse finished message" \ |
| 9100 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 9101 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9103 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9104 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9105 | skip_handshake_stage_check |
| 9106 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9107 | run_test "TLS 1.3:Not supported version check:gnutls: srv max TLS 1.0" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9108 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9109 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9110 | 1 \ |
| 9111 | -s "Client's version: 3.3" \ |
| 9112 | -c "is a fatal alert message (msg 40)" \ |
| 9113 | -S "Version: TLS1.0" \ |
| 9114 | -C "Protocol is TLSv1.0" |
| 9115 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9116 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9117 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9118 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9119 | skip_handshake_stage_check |
| 9120 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9121 | run_test "TLS 1.3:Not supported version check:gnutls: srv max TLS 1.1" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9122 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9123 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9124 | 1 \ |
| 9125 | -s "Client's version: 3.3" \ |
| 9126 | -c "is a fatal alert message (msg 40)" \ |
| 9127 | -S "Version: TLS1.1" \ |
| 9128 | -C "Protocol is TLSv1.1" |
| 9129 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9131 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9132 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9133 | skip_handshake_stage_check |
| 9134 | requires_gnutls_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9135 | run_test "TLS 1.3:Not supported version check:gnutls: srv max TLS 1.2" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9136 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9137 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9138 | 1 \ |
| 9139 | -s "Client's version: 3.3" \ |
| 9140 | -c "is a fatal alert message (msg 40)" \ |
| 9141 | -S "Version: TLS1.2" \ |
| 9142 | -C "Protocol is TLSv1.2" |
| 9143 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9145 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9146 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9147 | skip_handshake_stage_check |
| 9148 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9149 | run_test "TLS 1.3:Not supported version check:openssl: srv max TLS 1.0" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9150 | "$O_NEXT_SRV -msg -tls1" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9151 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9152 | 1 \ |
| 9153 | -s "fatal protocol_version" \ |
| 9154 | -c "is a fatal alert message (msg 70)" \ |
| 9155 | -S "Version: TLS1.0" \ |
| 9156 | -C "Protocol : TLSv1.0" |
| 9157 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9158 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9159 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9160 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9161 | skip_handshake_stage_check |
| 9162 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9163 | run_test "TLS 1.3:Not supported version check:openssl: srv max TLS 1.1" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9164 | "$O_NEXT_SRV -msg -tls1_1" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9165 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9166 | 1 \ |
| 9167 | -s "fatal protocol_version" \ |
| 9168 | -c "is a fatal alert message (msg 70)" \ |
| 9169 | -S "Version: TLS1.1" \ |
| 9170 | -C "Protocol : TLSv1.1" |
| 9171 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9172 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9173 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9174 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9175 | skip_handshake_stage_check |
| 9176 | requires_openssl_next |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9177 | run_test "TLS 1.3:Not supported version check:openssl: srv max TLS 1.2" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9178 | "$O_NEXT_SRV -msg -tls1_2" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9179 | "$P_CLI min_version=tls13 max_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 9180 | 1 \ |
| 9181 | -s "fatal protocol_version" \ |
| 9182 | -c "is a fatal alert message (msg 70)" \ |
| 9183 | -S "Version: TLS1.2" \ |
| 9184 | -C "Protocol : TLSv1.2" |
| 9185 | |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9186 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9187 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9188 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9189 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9190 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9191 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9192 | run_test "TLS 1.3: CertificateRequest check - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9193 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9194 | "$P_CLI debug_level=4 force_version=tls13 " \ |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9195 | 1 \ |
| 9196 | -c "CertificateRequest not supported" |
| 9197 | |
| 9198 | requires_gnutls_tls1_3 |
| 9199 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9201 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9202 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9203 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9204 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9205 | run_test "TLS 1.3: CertificateRequest check - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9206 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9207 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
Jerry Yu | 936dffd | 2021-11-22 18:34:36 +0800 | [diff] [blame] | 9208 | 1 \ |
| 9209 | -c "CertificateRequest not supported" |
| 9210 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9212 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9213 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9214 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9215 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9216 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9217 | run_test "TLS 1.3: HelloRetryRequest check - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9218 | "$O_NEXT_SRV -ciphersuites TLS_AES_256_GCM_SHA384 -sigalgs ecdsa_secp256r1_sha256 -groups P-256 -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9219 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9220 | 1 \ |
| 9221 | -c "received HelloRetryRequest message" \ |
XiaokangQian | 0b56a8f | 2021-12-22 02:39:32 +0000 | [diff] [blame] | 9222 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO(1)" \ |
| 9223 | -c "Last error was: -0x7180 - SSL - Verification of the message MAC failed" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9224 | |
| 9225 | requires_gnutls_tls1_3 |
| 9226 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9228 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9229 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9230 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9231 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 9232 | run_test "TLS 1.3: HelloRetryRequest check - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9233 | "$G_NEXT_SRV -d 4 --priority=NONE:+GROUP-SECP256R1:+AES-256-GCM:+SHA384:+AEAD:+SIGN-ECDSA-SECP256R1-SHA256:+VERS-TLS1.3:%NO_TICKETS" \ |
Jerry Yu | 52a6e7e | 2021-12-06 18:24:46 +0800 | [diff] [blame] | 9234 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9235 | 1 \ |
| 9236 | -c "received HelloRetryRequest message" \ |
XiaokangQian | 0b56a8f | 2021-12-22 02:39:32 +0000 | [diff] [blame] | 9237 | -c "tls13 client state: MBEDTLS_SSL_CLIENT_HELLO(1)" \ |
| 9238 | -c "Last error was: -0x7180 - SSL - Verification of the message MAC failed" \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 9239 | -s "HELLO RETRY REQUEST was queued" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9240 | |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 9241 | for i in $(ls opt-testcases/*.sh) |
| 9242 | do |
| 9243 | . $i |
| 9244 | done |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 9245 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9246 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9248 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9249 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9250 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9251 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9252 | run_test "TLS 1.3 m->O both peers do not support middlebox compatibility" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9253 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 9254 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9255 | 0 \ |
| 9256 | -c "HTTP/1.0 200 ok" |
| 9257 | |
| 9258 | requires_openssl_tls1_3 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9260 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 9261 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9262 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9263 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9264 | run_test "TLS 1.3 m->O server with middlebox compat support, not client" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 9265 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
| 9266 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9267 | 1 \ |
| 9268 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 9269 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9270 | requires_gnutls_tls1_3 |
| 9271 | requires_gnutls_next_no_ticket |
| 9272 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9273 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9274 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9275 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9276 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 9277 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9278 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 9279 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
| 9280 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9281 | 0 \ |
| 9282 | -c "HTTP/1.0 200 OK" |
| 9283 | |
| 9284 | requires_gnutls_tls1_3 |
| 9285 | requires_gnutls_next_no_ticket |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 9286 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 9287 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 9288 | requires_config_enabled MBEDTLS_DEBUG_C |
| 9289 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 9290 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9291 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 9292 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
| 9293 | "$P_CLI debug_level=3 min_version=tls13 max_version=tls13" \ |
| 9294 | 1 \ |
| 9295 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 9296 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9297 | # Test heap memory usage after handshake |
| 9298 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 9299 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 9300 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9301 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9302 | run_tests_memory_after_hanshake |
| 9303 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9304 | # Final report |
| 9305 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9306 | echo "------------------------------------------------------------------------" |
| 9307 | |
| 9308 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9309 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9310 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9311 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9312 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9313 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9314 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9315 | |
| 9316 | exit $FAILS |